With the improvement of railway networks and the increase of train services, more and more passengers are choosing rail transportation. Optimizing train timetables can effectively enhance passenger satisfaction and improve the quality of railway passenger transportation services. In this paper, we develop a method for optimizing long-distance train timetables considering passenger travel time preferences. Based on statistical analysis of departure time preferences and arrival time preferences, Gaussian functions are employed to fit these preference functions. Subsequently, a mixed-integer programming model is formulated to optimize the long-distance train timetable, aiming to maximize passenger travel time preferences and minimize train operation time, while considering constraints such as headways and the range of dwelling times at stations. To solve this mixed-integer nonlinear problem, an improved genetic algorithm incorporating parallel selection and elite retention mechanisms is designed. Finally, the proposed optimization model for long-distance train timetables is applied to a real scenario on the Beijing-Guangzhou Railway. Results indicate a 33.6% improvement in passenger travel time preferences in the optimized timetable, and a reduction in undesirable train stops during "passenger sleeping hours" from 86 occurrences to 26.