Yes, and you have to go even further and more general. The solution is actually urbanism. You can't just build trains and hope everything is gone be fine.
Living in low or high density urban environments is far more efficient in pretty much every single way that we can measure. CO2, energy, land use, water use and so on, and not just by a little but by a huge margin.
Transport can be electrified trains, trams, trolly buses, metros. This uses very few battery materials and essentially no new technology. All technology read to deploy in large numbers.
This would also 'solve' the housing crisis as increasing density around transportation with mixed use is what leads to much cheaper living cost (housing and transportation need to be seen together).
This talk by famous City Planner Peter Calthorpe is really good and goes into detail. He and his teams were charged with making a few projection plans for California and have really good numbers on all of these things (except the nuclear I mentioned):
https://www.youtube.com/watch?v=fUtdFbK4YG4
He has other great talks about his work in China as well, this is a bit more academic:
https://www.youtube.com/watch?v=KqldZhxl86I