In this TL, Mexico is a great power whose military power was greater. Having achieved its separation from the mother country with an agreement (the establishment of a Bourbon prince, don Carlos, in the throne), Mexico had its wealth as well trade routes left intact. The country has developed an important navy, as the result of the Mexican War of Independence in which Mexico seized Cuba. This it's not farfetched: in OTL military tradition in the Spanish Empire was more established that it was in Northern America. As a result, Mexico has an important army.
Anyway, the USA are expanding to the Pacific coast. In which sense this can be changed by the presence of a more powerful country, which indeed alter the balance of power in North America? The possibility of a war between both countries is real. But when does it will start and what is going to be the outcome? Consider that the Texan rebellion (1835-6) was crushed by the Royal Mexican Army.
Which are the effects for both countries?
I believe war is going to have place but I wonder if it is going to be delayed or anticipated. In anycase, how war will develop? and what would be the outcome and why?