There is an easy answer for Mexico's problem with taking back non Mexicans
Mexico can avoid this problem by stopping illegal crossings into Mexico at its southern border. It can also quite giving them free rides north and travel visas to come to the US border. That would solve ethe problem for both countries.
Mexico says it won't take border-jumpers back from the U.S. if they're not Mexicans as Secretary of state and Homeland Security chief prepare for chilly reception
'The Mexican people do not have to accept provisions that one government unilaterally wants to impose on the other,' Mexican Foreign Minister Luis Videgaray said Wednesday.