It is, of course, impossible to know for sure. However, I would argue that Mexico would not be much different while the US would be much smaller and weaker.
Mexico would not be much different economically because Mexico's problem is not a lack of resources. Yes, Mexico would have had the gold in California, but it would likely have only led to the rich getting richer, not to more equality and a more stable government. The major difference would be that Mexico would not have as much cause to resent the US.
The US, on the other hand, might well be very different. We would have been less likely to believe in manifest destiny and might not have taken Hawaii and the Philippines later in the century. If that had happened, we might never have been involved in WWII because there would have been no reason for Japan to attack.
There are, of course, many other ways that this could have played out.