Ford Motor Co. on Tuesday scrapped a plan to build a $1.6 billion small-car factory in Mexico that Donald Trump had slammed, a move announced just hours after the president-elect knocked General Motors Co. on Twitter for importing compact cars from Mexico to sell in the U.S.

The developments escalate the tension over trade policy between Mr. Trump and U.S. corporations. Analysts say the auto industry has the most at stake over Mr. Trump’s vow to renegotiate the North American Free Trade Agreement, which has allowed car makers...