Mexico does not enforce the 6-month validity rule for passport holders, therefore in the eyes of the Mexican government, you would be traveling with a valid passport. However, it's important to remember that you cannot stay longer than 180 days.