For Mr. Kushner, progress on Mexico would be a bright spot in what has been a difficult stretch. He was recently stripped of his top-secret security clearance and faces a hostile reception from Palestinians to his Middle East peace plan after Mr. Trump recognized Jerusalem as the capital of Israel. His future in the White House is regularly scrutinized, though he has told colleagues he is not going anywhere.

Mr. Kushner’s aides acknowledge his work could be overshadowed by a breakdown in talks over Nafta. The two countries are in the final stages of negotiations, with officials from both sides putting the odds of a deal at no better than 50-50. Then there is the relationship between Mr. Trump and Mr. Peña Nieto, which has fallen apart twice during angry telephone exchanges over who should pay for the wall.

This month, Mr. Trump dispatched Mr. Kushner to Mexico City to mend fences with Mr. Peña Nieto after their latest clash prompted the Mexican leader to cancel a visit to Washington. The Mexican news media harshly criticized Mr. Peña Nieto for receiving Mr. Kushner, a sign of just how toxic the Trump name has become there.

“I give both of them credit for doing it,” said Jorge Guajardo, a Mexican diplomat who served as his country’s ambassador to China. “In very adverse circumstances, Jared is working to keep things going.”

Still, Mr. Guajardo noted that Mexico had long worked with the United States on projects related to the border. These agreements, however useful, cannot repair the damage done by Mr. Trump’s inflammatory words about Mexicans crossing the border or his demands that Mexico underwrite the wall.

“We’ve been doing it for a long time, without all the acrimony, without all the attacks, without the president saying that Mexicans are terrible people,” Mr. Guajardo said.

At the heart of Mr. Kushner’s involvement with Mexico is the relationship he has cultivated with Mr. Videgaray, a close adviser to Mr. Peña Nieto who, as finance minister, brokered Mr. Trump’s visit to Mexico City during the 2016 presidential campaign.