Fourteen of Mexico's 31 states and the federal district Mexico City have marriage equality and same-sex couples can marry in the other 17 states if they go to a federal judge and get an injunction (amparo), a process that is time-consuming and requires paying a lawyer for help. The judge cannot refuse the amparo.
The requirement on judges resulted from a 2015 ruling by the Supreme Court of Justice of the Nation (SCJN) that declared all bans on marriage equality unconstitutional. The Supreme Court, however, has no power to end all states' bans simultaneously, and can only force individual states' bans out of existence in specific situations.