The boat was travelling off the southern border state of Chiapas when it listed to one side, pitching its occupants into the water, the state prosecutor’s office said in a statement.
A 39-year-old man was found dead, it added, washed up on the shore. The second body was later located a few hundred metres from the first.
A search operation “managed to rescue eight migrants alive”, the prosecutor’s office said, adding one person was still missing.
All were from Cameroon, a country that has seen a growing exodus amid an increasingly violent conflict between its French and English-speaking communities.
Chiapas is the main crossroads for migrants crossing Mexico towards the United States. They are mostly Central Americans, but in recent years, there has been an increasing number of Africans, who often fly to South America and then make long treks overland and by boat.
African migrants in Chiapas regularly stage protests demanding the Mexican authorities allow them to continue their journey towards the US.
Undocumented migrants regularly use boats to evade the authorities in southern Mexico, where the government has deployed 6,000 National Guard personnel to tighten the border.
The move is part of its efforts to crack down on irregular migration under a deal to avoid US President Donald Trump‘s threat to impose steep tariffs on Mexican goods.
Under the deal, the Mexican government has deployed another 15,000 National Guard personnel along its northern border and accepted the return of more than 50,000 migrants seeking asylum in the US, who must now wait in Mexico while their claims are processed.