Improved relations between Japan and South Korea could bolster the president’s legacy — if they endure.