Well, to throw my two cents in, the US probably could have taken the border states with a point of divergence as of the war, at least. They wanted to get Baja California as it is, and that would be requisite if the US wanted the mouth of the Colorado river. After that, it only depends on how much they wanted to press, and if they decided to use the second set of funds that were delegated for any further concessions.
Now, what might be better is to take the timeline a few years back. A more favorable Adams-Otis treaty could have encouraged greater concessions, but that is unlikely unless problems in Spain become stupendously bad. After that, the next best thing would be for the Rio Grande Republic to survive longer. It doesn't have to exist for long, but if it manages to stay afloat for a few years, allowing the natives to build an identity separate from Mexico proper, that might be enough for the US to take advantage of it.
Compound that with an earlier Republic of Yucatan, and an earlier letter to the US Congress asking for joining the Union, and you might see the US looking to acquire them all. In addition to Texas's disputed territories and California, the US could demand the Rio Grande Republic and its disputed territories, the Republic of Yucatan and any disputed territories, and the adjacent territories of Baja California, Sonora, Sinaloa, and a few disparate territories to establish clean and defensible borders.
This, of course, requires the chips to fall in the right place to create such a favorable turn of events, but it doesn't seem out of the realm of possibility. And this does not mean that the US could hold its gains after the war. The Yucatan would be very tricky, as stated earlier.
Let's say that this does happen. What would happen as a result of this? The various Mexican states (now territories) would request statehood. The North would be very concerned, as they fall under the Mason-Dixon. However, if I recall correctly, the natives would not have been very fond of slavery being extended to their territories. The dynamic would be very awkward, to say the least.
As for demographics, it was stated that in a previous thread that there would be about 2.5 million natives in the additional annexed portion. Two million would be on the mainland. I don't recall the percentage, but a lot of the natives of Alta California left for Mexico proper. They would have received citizenship after so many years, but they chose to leave. I believe that it was over 50%.
For assumptions sake, let's say 25% from the other possessions leave total. Which would give 1.5 million on the mainland, most of which probably would be concentrated around the Rio Grande Republic. (what would a demonym for a resident of that republic be, anywho?) That doesn't count the natives, which didn't all speak Spanish, either.
tl;dr, It certainly would be possible. The US didn't even get its starting position IOTL, mind. And it could have been a lot more favorable.
As for Mexico, a favorable point of divergence would be needed for them to keep California, but it certainly isn't impossible. It would be very hard to keep the Louisiana territory, considering how fast the US grows. A very unfavorable turn of events in 1812, with the US losing a lot of its territory, could give Mexico enough time to grow north. After that, the butterflies begin to flock a bit too much to tell what could potentially happen.