This would end the mission, probably immediately.
Curiosity comes in at 900 kg mass, so in Martian gravity its weight is ~3340 N. On a hard surface, to right it would require a torque of that weight acting through the moment arm (center to wheel rims) of 1.4 m, so ~4700 N-m, assuming that in the wheels are in contact with some hard surface in the inverted position. But on a flat hard surface those wheels wouldn't be in contact with anything until the body had rotated ~30° (envision an upside-down bug!) so the torque required from that point would be decreased by the cosine of 30°, dropping to ~4050 N-m.
The only actuator on Curiosity that could hope to supply a righting torque, over a large enough range of motion, is the robotic arm. That arm is 67 kg and is 2.1 m long with an elbow and a wrist for positioning 34 kg of instruments. At full extension in Martian gravity the actuators must supply at least ~530 N-m of torque to raise the arm from a low position, but this is a lower limit. The arm was tested to withstand 977 N of applied force without structural failure, for a torque (at full extension) of ~2050 N-m, but this is an upper limit: the actuators are not designed to supply enough torque to break the arm!
That upper limit is still a factor of ~2 short of the torque needed to right the vehicle, so @RusselBorogrove, your intuition is right on the money. Curiosity cannot right itself from an upside-down position, on a flat surface.
If it's on a steeply sloped (>30°) surface, though, having the arm press down on the upslope side could do the trick. But you have to make sure that, when it flips, it doesn't continue flipping, and wind up upside-down again, just farther downslope—or even in an uncontrolled roll down the slope. Since the rover already flipped, it would be hard to be sure of that.
But even righted, its capabilities would be severely impacted. On the top deck are several critical things not designed to take the load of the rover's weight, much less the dynamic loads of flipping over. This includes the MastCam and its mast, and most important: the directional radio antennas for communicating directly with Earth or with the orbiters that are there. When upside down those couldn't function at all, even if intact, which is highly unlikely. Even the low-gain antenna (LGA) would be against, or nearly against, the Martian surface, so it would be radiating its signals at the Martian surface. Some signal might leak out, but it would be severely attenuated compared to its normal function. For reception of commands from Earth its received signal would be equally attenuated, so it would be difficult to get any commands through.
If righted, the only hope for any kind of continued mission rests in having either the steerable UHF antenna or the X-band high-gain antenna (HGA) intact, and the pointing mechanisms working, and this is highly unlikely. If those antennas are unusable, the data rate from the LGA is far too low for any of the science Curiosity is after, especially too low for more than a couple of low-resolution images per day.
The MMRTG that powers Curiosity probably wouldn't care much about the upset, as long as none of the electrical or thermal connections to the rover aren'tare severed. But with all the other damage that would happen, the MMRTG likely wouldn't have any reason to power anything, or keep anything warm. The mission would be over.