This paper proposes an algorithm for the cooperative operation of air conditioning facilities and the energy storage system (ESS) in railway stations to minimize electricity. Unlike traditional load patterns, load patterns of an urban railway station can peak where energy charge rates are not high. Due to this possibility, if applying the traditional peak-reduction algorithm to railway loads, energy changes can increase, resulting in higher electricity bills. Therefore, it is required to develop a new method for minimizing the sum of capacity charges and energy charges, which is a non-linear problem. To get a feasible solution for this problem, we suggest an algorithm that optimizes the facility operation through two optimizations (primary and secondary). This method is applied to the air-quality change model for operating air conditioning facilities as demand-response (DR) resources in railway stations. This algorithm makes it possible to estimate operable DR capacity every hour, rather than calculating the capacity of DR resources conservatively in advance. Finally, we perform a simulation for the application of the proposed method to the operation of DR resources and ESS together. The simulation shows that electricity bills become lowered, and the number of charging and discharging processes of ESS is also reduced.