I wouldn’t say they are terrible, but i must admit i haven’t looked in to it much, and don’t have much to compare with. The N9 was considered having a great camera back in its day, and i’m fairly sure the Xperias are better, perhaps not by a lot.
I think you may have a point when you say the images may be compressed too hard - but i also expect someone to have tuned that to a reasonable compromise.
For comparison; the N9 does 7Mp at roughly 1.2-2.4MB and my work Samsung Galaxy S9 gives a random shot at 12Mp 3.7MB to play with, and 2.8 for another. Doesn’t seem like a world apart, and it can certainly be less than 6MB. Perhaps some more quality could be preserved with less aggressive compression, but it makes me suspect it is mostly the lack of fancy image processing.