There was large-scale house-building in Midlothian long before the railway was opened; Lothian Buses got funding to serve new developments in the Bonnyrigg area more than 20 years ago .
I guess the railway makes development in the more distant parts like Gorebridge more attractive, and houses close to stations may be a bit pricier than those further away, but I doubt if it has made a big difference to the urbanisation of the area.
The same is likely true of the Borders - Gala/Tweedbank may be a bit more attractive but there is also a lot of development in towns away from the railway, like Peebles or Lauder (on the A68).
I guess the railway makes development in the more distant parts like Gorebridge more attractive, and houses close to stations may be a bit pricier than those further away, but I doubt if it has made a big difference to the urbanisation of the area.
The same is likely true of the Borders - Gala/Tweedbank may be a bit more attractive but there is also a lot of development in towns away from the railway, like Peebles or Lauder (on the A68).