TORONTO — Donald Trump, newly elected, was threatening to impose crippling tariffs on Mexico and Canada over what he called an “invasion” of migrants and fentanyl into the United States.