With growing concerns over resource depletion and environmental degradation, the role of high-speed railways in fostering a transition towards sustainable energy sources has gained prominence. Against this background, we treat the opening of high-speed railways as a quasi-natural study, analyze data from Chinese industrial enterprises and 285 prefecture-level cities to investigate the impact of high-speed railways on environmental sustainability, specifically focusing on fossil fuel consumption and carbon emissions. Our results unequivocally demonstrate that the introduction of high-speed railways has been instrumental in promoting eco-friendly development, as evidenced by a notable reduction in traditional resource consumption and carbon emissions along the railway routes. This inhibitory effect has strengthened over time and with increasing distance from the railway. Additionally, we identify significant spatial spillover and spatial conduction effects resulting from high-speed railway operations. Heterogeneity tests reveal that third-tier cities, non-megacities, and mature resource-based cities are particularly receptive to these sustainable impacts. Besides, Mechanism analysis suggests that accelerated elements flow, enhanced technological innovation, improved labor productivity, and upgrading of industrial structure serve as potential pathways leading to eco-sustainability. These findings highlight the environmentally friendly attributes of high-speed railways and underscore the pressing need for effective policy measures to facilitate a global transition towards renewable energy, both in China and worldwide.