New railway tunnels could provide locally sourced clean, cheap heating and cooling for nearby homes and businesses, according to a new study.