The transition towards environmentally friendly transportation solutions has prompted a focused exploration of energy-saving technologies within railway transit systems. Energy Storage Systems (ESS) in railway transit for Regenerative Braking Energy (RBE) recovery has gained prominence in pursuing sustainable transportation solutions. To achieve the dual-objective optimization of energy saving and investment, this paper proposes the collaborative operation of Onboard Energy-Storage Systems (OESS) and Stationary Energy-Storage Systems (SESS). In the meantime, Non-dominated Sorting Genetic Algorithm-II (NSGA-II) is applied to optimize the ESS capacity and reduce its redundancy. The simulation is programmed in MATLAB. The results show that the corporation of OESS and SESS offers superior benefits (70 kWh energy saving within 30 min operation) compared to using SESS alone. Moreover, the OESS plays a significant role, emphasizing its significance in saving energy and investment, therefore presenting a win–win scenario. It is recommended that the capacity of OESS be designed to be two to three times that of SESS. The findings contribute to the ongoing efforts in developing more sustainable and energy-efficient transportation solutions, with implications for the railway industry’s investment and broader initiatives in energy saving for sustainable urban mobility.