An artificial neural network (ANN) has been proposed in this paper to determine the optimal coasting speed of train operation for the Kaohsiung Mass Rapid Transit (KMRT) system to achieve the cost minimization of energy consumption and passenger traveling time. A train performance simulation (TPS) is applied to solve the energy consumption and the traveling time required to complete the journey between stations with various riderships to create the data set for ANN training. The ANN model for the determination of the optimal coasting speed is then derived by performing the ANN training. To demonstrate the effectiveness of the proposed ANN model, the annual ridership forecast of the KMRT system over the project concession period from 2007 to 2035 has been used to determine the optimal coasting speed of train sets for each study year according to the distance between stations and the passenger ridership. The power consumption profile of train sets and the traveling time of passengers have been solved by TPS to verify the reduction of social cost for KMRT system operation with the optimal coasting speed derived.