That is the intractable political problem. Short term pain is unavoidable to get to the long term fix, and voters have no tolerance for short term pain (still measured in decades).
The problem is that cars made it possible for people to live in those sorts of places, cheaply enough.
Not a solution, just an observation. If cars weren't really a thing, people would live in denser communities with walkable services (I include rural communities in this. Pre-car villages are pretty dense, and have, you know, things like shops, etc.).
Is that really true? We were getting around with horses before cars. You have to go back real far to get to a point where we weren't getting around faster than walking
Horses aren't that much faster than walking. Horses can go about 30 miles/day. (That's the reason the Spanish mission towns in the US west were spaced about 30 miles apart.)
That's also about what people can walk in a day (Appalachian Trail through-hikers do about 3 miles per hour).
Now, trained trail horses can go far further in a day, but they require specialized training, food, and care, making them a very expensive plow-horse or cart-horse.