Simultaneously considering train scheduling problem and maintenance planning problem with uncertain travel time, we propose a two-stage integrated optimization model for the sunset-departure and sunrise-arrival trains (SDSA-trains). Specifically, in the first stage, we obtain an optimal solution of the SDSA-trains under each scenario, which leads to the minimum total travel time. In the second stage, a robust SDSA-train schedule is generated based on the optimal solutions of the first stage. The key is that we consider two operation modes to solve the conflict between the SDSA-trains and the maintenances. Some state variables are used to deal with train operation mode selection. Furthermore, some linearization techniques are used to formulate a mixed-integer linear programming (MILP) model. Finally, numerical experiments are implemented to prove the effectiveness of the proposed model and optimization method.