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.
If Mexico had won the war, I would speculate that both countries would be quite different. For one thing, it would have been far more difficult for the United States to enforce the Monroe Doctrine quite simply because the United States would have not have had the size, resources, and power to do so. The Monroe Doctrine was a foreign policy designed to keep European powers out of North and South America. It implicitly states that the United States is the keeper of the entire American continent (North and South), from Canada to Argentina. Consequently, the United States carried out further military interventions in several countries, including Mexico, which allowed the United States to become the prevailing power in the Western Hemisphere at the time (a power that subsequently expanded itself to other regions of the world). It should be mentioned that the Louisiana Purchase was another pivotal factor in the expansion of the frontier. This historical event, in my opinion, was more influential in the development of the United States than the Mexican American War in that it opened up the physical, political, and economic space for the US government to envision and pursue policies of expansion.