Lets look at a case with an ideal lens and sensor. Here's an MTF (contrast vs resolution) graph for a couple perfect lenses published by Bob Atkins with ideal APS-C sensor limits added by me:
The ideal resolution limits of the sensors correspond to a print at 100%. For a perfect f:8 lens, the 6mp sensor's resolution is about 62 lp/mm while the 12mp sensor's resolution is somewhat better at about 87 lp/mm. But the 6mp's fine detail has a contrast of about 65% while the fine detail in the 12mp image is only 50%. Which is better?
Maybe it is unfair to compare the two sensors at 100%, instead let's compare image quality at various print sizes. The SQF image quality is roughly proportional to the MTF at 2lp/mm on the display. The graph shows the display's 2lp/mm translated to the sensor by the enlargement factor.
I had to stretch the graph sideways to fit in normal display sizes. Notice there is no difference in predicted image quality until the 100% limit for the 6mp sensor is exceeded - until then the display is limiting the image quality, not the sensor or lens.
This is an idealized, schematic, simplified representation of what's going on. In real life, the sensor's MTF must be taken into account, which has the effect of bending the resolution curves so the total MTF goes to zero at the sensor's limit. Depending on details of sensor MTF shape, this could decrease the higher enlargement display image quality of the 6mp sensor compared to the 12mp sensor.
I hope this helps and isn't too confusing but it is a complex topic because there's so many ways to look at it.
Dave