The migrants from Guatemala, Honduras, and El Salvador were found in a truck, allegedly carrying carbonated beverages, in the southern Mexican state of Chiapas, according to the ministry.
They were brought to the migration department, together with two other individuals who were transporting them, the ministry said.
Last month, the United States and Mexico reached an agreement on curbing illegal migration through the US-Mexican border.
In May, a caravan-sized group of more than 1,000 people was taken into federal custody in western Texas after illegally crossing from Mexico into the United States, marking the largest single group the US Border Patrol has ever taken into custody at once.