This paper describes an optimization model for an irregular train schedule. The aim is to optimize both the maximum train loading rate and the average deviation of departure intervals under time-varying passenger transport demand for an urban rail transit line in consideration of practical train operation constraints, i.e., headway, running time between stations, dwell time, and capacity. A heuristic simulated-annealing algorithm is designed to solve the optimization model, and a case study of an urban rail transit line is performed to assess its efficacy. The results show that, compared with the current regular train schedule, the total train dwell time under the optimized irregular schedule is reduced from 900 s to 848 s, and the reduction ratio for the maximum train loading rate is from 1.2% to 3.6% for different stations. When the average train departure interval is allowed to vary from 120 to 170 s, the optimized irregular schedule decreases the maximum train loading rate of the collinear and noncollinear sections by 3.21%–4.82% and 2.52%–3.64%, respectively. Sensitivity analysis is performed for a nonnegative weight coefficient, average train departure interval, and proportion of full-length and short-turn routings. The proposed approach can be used to support capacity improvement and schedule optimization for urban rail transit lines.