Same sensor and lense vs MP's
one of the cameras came in a 8MP model the other in 12MP...
Probably the 12MP sensor is a newer technology. The design and manufacturing techniques will probably have improved for the newer design.
Since your question is hypothetical, it's not really possible to give one single correct answer. Most likely the 12MP sensor, being newer will overall perform better. Having said that, there have been examples of camera designers introducing additional noise reduction together with the increased pixel count, and poorly-implemented noise-reduction can seriously reduce detail.
The best advice I can offer is to choose a camera and lens based upon any criteria you like (including of course price), and ignore the number of MP.
There are other factors which are more important such as accuracy of colour rendition, or how shadow and highlight detail is captured. You won't find statistics on these, but I believe they are more important. And the only way to tell is to look at sample images - from a proper camera review such as those on this site, or various other review sites.