Climate change is one of the biggest global issues for humanity these days, and its effect has become more severe. The transport sector accounts for around 30% of greenhouse gas emissions, which need to be decarbonized urgently. Railway electrification is one of the low-carbon solutions, but it still relies on power grids causing carbon emissions. To further decarbonize electric railways, the renewable energy sources (RESs) and energy storage system (ESS) integration scheme for railway traction power network has been proposed. This paper developed the energy management system to calculate the energy flow and global cost. Moreover, contact wire loss and conversion loss were considered. The optimization problem to find the optimal capacity and location of the PV farm, wind farm and energy storage system to achieve the lowest global daily costs was solved by the Brute Force Algorithm. The traction network of the High Speed 2 Railway in the UK has been taken as a case study. Results revealed that the global cost and carbon emissions are reduced considerably with both ESS and RESs installed. In the scenario of the ESS alone, 1.3% of the global cost is saved by capturing the regenerative energy and reusing it. Furthermore, this figure goes up to 10% and 62% when the PV and wind farms are integrated, respectively. When considering all variables, it is found that installing the wind farm is a more economical option than the PV farm. The study also shows that the optimal locations to install the plants and ESS vary by scenario.