I think it was do or die for both sides.
Serviceability of the Mil fleet has become less then satifactonyry for Mexico. The support, when compared to western types, was non existent according the Mexican AF sources.
Transporting the planes back to Russia for overhaul was extremely expensive and did cut deeply into the rather limited budget available.
So the Mexicans looked at dropping the Mil fleet in the near future (bad as they are quite new), while the Russians faced a really probable loss of the south and central american market if Mexico would decide on such move.
That deal is a godsend for both sides.