In irking Mexico’s chief trading partners with decisions affecting energy firms, the country’s leftist President Andrés Manuel López Obrador is tinkering with the free-trade pact that is the very engine and ballast of Mexico’s vast, and vulnerable, economy.