We consider the problem of jointly optimizing train stop plan and timetable for a set of trains on a railway corridor, with focus on time-dependent passenger demand: these are very relevant elements in railway operations, and closely related to the service quality provided to the passengers. The train stop planning problem requires to determine the stopping pattern for each train, while the train timetabling problem calls for finding departure and arrival times of each train at each visited station. The solution of both problems determines the train services available to the passengers, with the corresponding stops, the departure and arrival times, and the total travel time. To define train services that are convenient for the passengers, it is important to satisfy the passenger demand: in particular, we take into consideration the desired departure time intervals of passengers from their origin station towards their destination station. Our goal is to determine a solution to the integrated problem that includes these three aspects (stop plan, timetable, time-dependent passenger demand). The integrated problem is solved at the tactical level, and includes constraints imposing that the demand is satisfied in the desired time intervals, and the train capacity is respected. The solution of the problem defines the train services, by determining the passenger flow on trains and the time intervals in which passengers have to be served.We formulate an Integer Linear Programming (ILP) model for this integrated problem, and solve it with the commercial optimization solver CPLEX on a real-world instance of the Wuhan–Guangzhou high-speed railway line in China, by considering different time interval lengths in which the demand must be satisfied. In addition, we compare the obtained results with those determined by solving a model that neglects the time-dependency of the passenger demand. The computational results show that the train stop plan and timetable are deeply influenced by the desired departure time intervals of the passengers, and that neglecting time-dependency results in more than 30% of the passengers departing in a different time interval than the desired one.