It's pretty clear to me that 'lighter' in the OP meant 'less massive'.
@bbbl67 This is important: there is currently little reason to think MW more massive than M31. The numbers in the OP cannot be taken at face value. They're at best bad reporting. You are attempting to draw conclusions about the structure of the galaxies from faulty assumptions.
I think it likely the MW mass is taken from this recent study (albeit with error bars conspicuously omitted), given how its press releases dominate the search results:
https://iopscience.iop.org/article/10.3847/1538-4357/ab089f/pdf
Various headlines tout it, as they often do, along the lines of: 'scientists accurately measure MW mass'. But it's just one of many such studies, and it's not that clear-cut.
First thing to notice here, is that the mass estimate of ~1.5 trillion M☉ (1.54 +0.75 - 0.44, so what it actually says is: 'between 1.1 and 2.3' trillion) is for the
virial mass. This is basically all the mass that can be considered bound to the galaxy, that is not another galaxy, while being sufficiently denser than the intergalactic medium to count for anything. Various studies will have this extend to different radii, but this one assumes everything within 300 kpc. That's ten times larger than the luminous disc radius. This will inevitably be mostly non-luminous halo of gas and dark matter.
Whereas the mass enclosed within the radius comparable to what is given in the OP (~40 kpc) is measured at ~0.42 (+0.07 -0.06) trillion. So you're already using incompatible values for even one galaxy. I.e. it's not true that the study claims there to be that much mass inside that much radius.
Furthermore, if you read through the discussion section, you'll see the results compared with other studies, and some limitations mentioned, which should hint at why this shouldn't be taken as be-all-end-all result.
But what you really want is a review study, like this one:
https://arxiv.org/pdf/1912.02599.pdf
Which highlights all the issues with various methods used, and how the results differ. It's a hefty read, but at least look at the summary and discussion section.
Now, it's true that with the advent of GAIA the results started to converge on a much narrower range of values than just a few years earlier, but it's still a range, as shown in fig.5:
The study referred to above is the Watkins19 one (showing lower value here due to the virial mass being rescaled so that all the studies use the same definition and can be meaningfully compared).
All this uncertainty is just for the MW, for which we have much better data. I wasn't able to track down the source for the M31 mass estimate (unless Facts For Kids counts). But, given what was discussed above, questions should immediately arise: What are the error bars? Is that the luminous mass or the virial mass? And if it's the latter, what is the definition in use? How does it look like in the context of other studies? Are we comparing apples and oranges? Etc.
If I were to guess, given that the same 'astronomy facts' websites that cite the number from the OP also give stellar population of M31 at 1 trillion (which also looks suspiciously like a half-arsed estimate from an intro astronomy class): 1 trillion times 1 solar mass + central black hole mass is almost the same number. So, at best, it's just what's in the disc and the bulge. No dark matter, no baryonic gas out to 300 kpc. Apples and oranges.
There's another point here, that the review study highlights - while it's difficult to accurately measure and compare the mass of either galaxy, the dynamics of the cluster as a whole provide a means to estimate the
ratio of their masses (section 7). These suggest M31 being
more massive than the MW by a factor of anywhere between ~1.2 and 4. I'd rely on this rather than on googled numbers of dubious provenance.
The lesson here being: be suspicious of precise numbers, don't jump to conclusions, check the sources, look at the bigger picture. The usual mantra of the information age.