The Mexican government only requires that your passport must be valid during the entirety of your trip. Please contact the airline(s) you will be flying on to ensure that they let you board the plane as the United States does have a six months validity rule for passports that may apply.