TOKYO—The leaders of Japan and the European Union signed a deal to create one of the world’s largest liberalized trade zones, a contrast to escalating trade disputes between the U.S. and several of its trading partners.

While the signing in Tokyo on Tuesday was largely ceremonial, it marked a rare moment of unity on trade. In recent months, President Donald Trump has launched an array of punitive tariffs on products from China and elsewhere, stating that the action is needed to correct the unfair trade advantages of other...