Mexican politics did not allow them to back down to the US. Mexico recognized the Nueces River as the boundary. Texas and the US claimed the Rio Grande. The US Army proceeded to march up to the Rio Grande in the disputed area. The Mexican Army decided to attack the American troops there. Unfortunately, the Mexican Army had arms and uniforms they bought from the British who used them in the Napoleonic Wars. Many of the American Volunteers had modern firearms that had rifling and percussion locks (caps). The American Artillery also was more modern and used tactics still in vogue in the ACW.
By the way, if one went by the Texas claim, Albuquerque and Santa Fe would have been in Texas...
Pruitt