Japan and Indonesia pledged on Saturday to deepen economic and defense ties during a visit by the Japanese prime minister amid heightened global geopolitical tensions.