but the reality is that there was a huge class of Polish and Ukrainian peasants who were almost indistinguishable
Yeah, sure. If according to your totally unfounded claim that they were "almost indistinguishable" then why are you still attributing terms like Polish and Ukrainian to them at all? Oh, that's right, because they were always VERY DISTINCT from each other. They knew it back then and you are in denial about it now.
Just like people living today, they too had ancestors who passed on language, history and other traditions down successive generations in their homes, local communities, schools and places of worship. They were also aware of who had ownership and wealth and who didn't and how this fell along ethno-linguistic lines.
Do you count Jews and Armenians among this "huge, almost indistinguishable, peasant class"? They were there too after all and certainly weren't running society from the top. No, of course you don't.
It doesn't matter what you want to believe anyway because you can't erase and rewrite history.
Indeed, if the linguistically-distinct, ethnically-aware denizens of Lwów & Galicja back then actually had a "we're all so much the same we don't know who we are" monoculture that you are trying to impose on them centuries later then you are the one who will have to explain, at the very least, the following:
- the Chmielnicki Uprising in 1648 and establishment of the Cossack Hetmanate;
- the establishment of a Ukrainian's People's Republic in 1917;
- the murder and displacement of tens of thousands of ethnic Poles from Galicja in 1943;
- the violent establishment of a "Jewish State of Israel" on Palestinian land in 1948 with both Zionist founders and subsequent waves of immigrants hailing from Galicja; indeed leaving Galicja in order to preserve their own identity with the ability to finally have political and economic power on someone else's land rather than remain in Galicja and continue to know their place