TOKYO—Japan’s prime minister has worked hard to build close ties with President Donald Trump. Now, as Shinzo Abe heads to the U.S. for another summit meeting, differences over trade and North Korea are testing that relationship.

Mr. Abe is due at Mr. Trump’s Mar-a-Lago resort for two days starting Tuesday. The Japanese leader raced to arrange the meeting after Mr. Trump surprised many by agreeing to talks with North Korean leader Kim Jong Un, a summit now slated for May or June.

Japan...