Not a bad idea, but there are several problems.
1) Mexican law is pitifully weak, and doesn’t permit serious sentences over a given number of years. No death penalty.
2) Mexican prisons are very weak and over capacity. They don’t even have enough room for serious felons and beg the US to not send them back except at a trickle.
3) Large parts of Mexico are in chaos and ruled by drug cartels, that actively recruit anyone who can fight. (Which is why “kicking them back across the border” doesn’t work anymore.)
4) Mexican Marines do most of the heavy combat, as they live sequestered on their bases having no contact with their own families. They are the only police or military units that can be trusted.
5) The current death toll in their drug wars exceeds 30,000 a year now.
This is not a complete list of their problems.
Yes, Mexico is lawless and chaotic, but infusion of American dollars to pay for our prisoners incarcerated in Mexican prisons, will help Mexico hire a better police force.
Cost savings to taxpayers would be hundred’s of Billions.
And after experiencing Mexican prisons, criminals would not want to continue life of crime for the risk of going back to Mexican prisons where the food is awful, there is no Gym, there is no library, no TV, no dental care, very poor healthcare.