TOKYO—"I would like to congratulate you on your historic victory in the midterm election in the United States," Japanese Prime Minister Shinzo Abe told Donald Trump during the recent G20 summit. Mentions of the remark occasioned knowing smiles here during a recent study trip sponsored by Japan's Ministry of Foreign Affairs. The election might not have been, strictly speaking, a "historic victory" for Trump—Republicans lost some 40 seats and control of the House of Representatives while adding two seats to their Senate majority—but Japanese voters are nonetheless aware of Abe's intention. He wants to be Trump's friend. More importantly, he needs to be.