WASHINGTON — The fate of a yearlong trade war will reach a pivotal moment this weekend as President Trump and President Xi Jinping of China meet in Japan. But while both leaders appear open to a truce, they have hardened their positions ahead of the talks, leaving it unclear how the United States and China will resolve the tensions that have thrust the world’s two largest economies into conflict.

Both leaders have an incentive to avoid a further escalation of a trade war that has battered companies and consumers on both sides of the Pacific. The global economy is weakening as a result of the trade war, with China and America feeling the effects, putting Mr. Trump’s re-election and Mr. Xi’s popularity at risk. But neither leader wants to be seen as capitulating or agreeing to concessions that could give them less leverage once trade talks resume.

“There are still big substantive issues to resolve,” said Derek Scissors, a China expert at the American Enterprise Institute. “I don’t know how you make a deal in the next year and a half that changes the direction of the U.S.-China relationship.”

The United States and China appeared to be on the cusp of a trade agreement in April, only to have negotiations collapse in early May after the Chinese government rejected some of the Trump administration’s demands. Tensions have only escalated since, with both sides ratcheting up tit-for-tat punishment, creating even more issues to resolve.