Mexico currently enjoys a $60 Bil trade surplus with U.S.
A 20% border tax on all goods from Mexico will result in a similar 20% retaliation tax by Mexico.
Both countries will be hurt but Mexico stands to lose much more based simply on the surplus. More serious, the taxes will discourage U.S. companies from investing in Mexico. U.S. can still attract bilateral trades from many other countries from a position of strength.
China has already been dumping Chinese goods into Mexico and Latin America. China is unlikely to open up its market to Mexico, unless for political reasons. Mexico will still is at a huge disadvantage in shipping good and services to China. China is unlikely to keep bankrolling its allies, as it is cognisant of how the former USSR imploded.
Any cooperation between China and Mexico militarily will give U.S. and excuse to pick a fight with China, as was done in the Cuban missile crisis. U.S. needs such excuse to hit on China and stop it from expanding in the South China Sea.
Strategically Mexico is toasted. Cooperating with Trump right now is in their best interest. It is better to swallow their pride right now rather than accept much worse terms under much dire situation later on.
Mexico should learn a lesson that it has to diversify it is economy and create real sustainable internal growth for its longer term survival.