Here in Berlin where I currently live the population grows by a out 50K people a year. There are housing shortages and people are struggling to find a place to live.
However the surrounding Brandenburg area has been depopulating since the wall fell. Lots of little ghost towns there. And it's not even that far. There's plenty of housing available if you can tolerate the inconvenience of a shitty commute.
IMHO the coming revolution of autonomous driving is going to lower the cost and inconvenience of living a bit further away. It enables working or relaxing while you commute. A two hour commute is much less of a problem if you can be a bit productive. And of course you don't have to do that everyday. Lots of people work remotely some or all of the time.
Autonomous driving could also lower the cost of public transport by eliminating the cost of drivers and fossil fuels. Most of the reason of remote villages being underserved by public transport is cost. On demand pickups/dropoffs and more flexible scheduling could further address that. And it's a lot cheaper than commuter rail extensions.