Then, early on Wednesday, it watched as Donald J. Trump became the next American president: a man whose central campaign promises included building a wall between the two countries, upending decades-old trade deals and deporting millions of Mexican immigrants.