> They don't put wealthy neighborhoods near railroads carrying toxic chemicals.
Usually the causality is reversed... Railroads carrying toxic chemicals exist, and wealthy people are able to opt to invest in properties not near these undesirable things.
I know that sounds pedantic, but it's important to note that "they" didn't "put" neighborhoods with preordained social classes somewhere... They zoned neighborhoods and if they'd said you weren't allowed to build houses there, they'd have been accused of nimbyism, not building enough housing to keep up with demand, etc.