Affluence would not equalize _because_ they’re living near each other. Living near each other, though, seems to me to be something that would have to evolve alongside a more equal society.
If we go by your assumption that the squares are richer or happier, it seems obvious to me that if they are biased to only want shapes like them to live near them it’s likely they also don’t want them to associate with them at work. Associating together is surely necessary if the triangles are to better their lot in life?
I suppose you might argue that if squares and triangles are equal in talents, they could eventually form separate but equal societies, even if they did not want to associate. If they’re starting off from different baselines that seems unlikely to me though.
It also seems to me to carry an assumption that not wanting to associate is at best a morally neutral position, which I don’t believe - but I think you may?
To your more specific example: there are so many differences between urban and rural societies that I don’t believe that looking as diversity as the attribute that explains their current states is particularly illuminating, especially if you’re trying to decide which one is ‘better’.
I do believe, though, that historical bias has a hand in explaining why even diverse societies like cities are still so stratified on racial lines (so, _not_ diverse).