Mexico had too many internal problems to be a competitive peer to any of the great powers (or burgeoning great power like the US in the 19th century).
Its workforce was mainly illiterate and unskilled.
Its elites were heavily divided which lead to ongoing political disputes, civil wars, and rebellions.
Its social institutions, rule of law, and infrastructure were too undeveloped.
Most of this was the legacy of Spanish colonial rule, and the elite that resulted from independence.
There are no easy fixes. Mexico needs both a lot of time, and a lot of good luck in leadership to become a great power. By the late half of the 21st Century, Mexico will probably be a very important country in real life with a political system, economy, and civic society able to exploit Mexico's size, population, and natural resources. But it will have taken a lot of changes to get it to there.