Hundreds of migrants from Africa, the Caribbean and Central America found themselves corralled in a migrant detention facility in southern Mexico on Sunday after a futile attempt to head north as part of a caravan aiming to reach the United States.