Well, not sure how the conflict would escalate into war. But assuming it does, at this point Santa Anna is in power and enjoying a brief rise in popularity due to his success and sacrificer (he lost his leg) during the Pastry War against the French.
On one end, this means that the Mexican generals will be united and not squabbling over who gets the glory; Santa Anna will. In OTL the Mexican presidency changed hands four times (Valencia, Paredes, Salas, Farias) before Santa Anna returned from exile and taking over (he quit just as the US took Mexico City, and left the peace in the hands of one of his lackeys).
Santa Anna - looking after his own interests - might sue of peace sooner. Say Santa Anna sues for peace after Veracruz falls and the Americans reach Puebla. In the subsequent treaty, Mexico will be forced to recognize Texas' independence and subsequent annexation. And, say, secede everything north of the 37th parallel? Unlike Polk, His Accidency President Tyler, might not feel the need to push for more territory.
Santa Anna will fall out of favor right afterwards regardless. And Mexico will return to its usual instability, hard to say what happens. Best case scenario, the Federalistas gain power, reinstate the 1824 constitution, and Mexico stabilizes. Worst case, Mexico follows path similar to OTL, but this time the Rio Bravo Republic is not a ruse against Santa Anna but a real movement; they follow Yucatan into independence, and the joined by the remainder of California.
As far as the US. The 1844 election would be quite different, just out of war - the successful Whig Party is likely to nominate a general (Taylor or Scott take your pick) while Polk might remain an obscure choice for the Democrats, more likely to renominate Van Buren.