If you are visiting Mexico as a visitor/tourist and you lose your visitor's permit, you will need to attend a local immigration office (in a town or city or at the airport) to apply for a replacement; there is a fee of around US$40 involved—the local immigration office will advise you of the current replacement fee.