Global demand for fossil fuels is highly increasing, necessitating energy efficiency to be enhanced in transitioning to low-carbon energy systems. Electric railways are highly efficient in reducing the transportation demand for fossil fuels as they are lightweight and their energy demand can be fed by renewable energy resources. Further, the regenerative braking energy of decelerating trains can be fed to accelerating trains and stored in onboard energy storage systems (ESSs) and stationary ESSs. It is fundamental to model electric railways accurately before investigating approaches to enhancing their energy efficiency. However, electric railways are challenging to model as they are nonlinear, resulting from the rectifier substations, overvoltage protection circuits, and the unpredictability and uncertainty of the load according to the train position. There have been few studies that have examined the ESS location’s impact on improving the energy efficiency of electric railways while using specialised simulation tools in electric railways. However, no single study exists that has studied the location impact of stationary ESSs on the energy efficiency of electric railways while the trains are supported by onboard ESSs. Given these goals and challenges, the main objective of this work is to develop a model using commercial software used by industry practitioners. Further, the energy saving is aimed to be maximised using stationary ESSs installed in optimal locations while trains are supported by onboard ESSs. The model includes trains, onboard ESSs, rail tracks, passenger stations, stationary ESSs, and traction power systems involving power lines, connectors, switches, sectioning, and isolators. In this article, a test scenario is presented comprising two trains running on a 20 km with three passenger stations and two substations. The trains and track are modelled in OpenTrack simulation software (Version 1.9) while the power system is modelled in OpenPowerNet simulation software (Version 1.11). The two simulation tools are used in the railway industry and can produce realistic results by taking into account the entire electrical network structure. A stationary ESS is added on the wayside and moved in steps of 1 km to obtain the optimal location before investigating the impact of stationary ESSs on the performance and energy management of onboard ESSs. It is found that the energy saving when installing a stationary ESS at the optimal location is 56.05%, the peak-power reduction of Substation 1 is 4.37%, and the peak-power reduction of Substation 2 is 18.67%.