The migrants were held for 20 days in the town of Celaya, about 210 kilometres (130 miles) from Mexico City, said Secretary of State Security Juan Jose Gonzalez.
They told officials that their relatives had been making payments to their captors during that time, Gonzalez said.
The victims were receiving medical attention after their ordeal, he added.
Separately, the security ministry announced the arrest of 59 migrants, including 55 Hondurans, around the northeastern town of Saltillo, near the US border.
Thousands of Central Americans attempt to cross Mexico in so-called 'caravans' every year in the hope of reaching the United States (US) to seek refuge from violence and poverty at home.
After US President Donald Trump threatened Mexico with tariffs, Mexican leader Andres Manuel Lopez Obrador agreed last month to crack down on undocumented migration, deploying tens of thousands of National Guardsmen to tighten its borders.
Mexico deported 33 per cent more foreigners month-on-month in June, officials said this week.
The migrants are frequent targets for violent criminal gangs operating in Mexico, where more than 40,000 people have been officially reported missing.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ