This paper presents an PSO-based optimization methodology for estimating the capacities and initial SOC of an energy storage systems (ESSs) in a DC electric railway system. The proposed method calculates the optimal solution using the missing capacity caused by the limited storage capacity. The missing capacity can be estimated through continuous-powerflow analysis. In many previous studies, capacities was calculated by assuming the each ESS as an independent device. However, since each storage device affects the charging and discharging operation of each other, this assumption might affect the convergence characteristics. In this paper, to solve this problem, the missing capacity of the ESS at both sides is reflected by using the relating coefficient derived based on the electrical distance between storage devices. The case studies show that the most efficient operation without missing capacity is possible under the derived capacities and initial SOC.