High freight and passenger-carrying capacity, providing a fast and safe journey, and its tourism potential, railway transportation remains preferable among transportation types. Many personnel perform different tasks such as operation, administration, maintenance, security, and cleaning on the railways to provide an excellent service to the passengers. These personnel are among the most critical parts of the railway system in infrastructure, passenger, and freight transport. This study aims to create a schedule by using mathematical methods for the personnel working in the railway system. The goal programming method, which enables to achieve more than one goal simultaneously, was used to solve the problem. It is planned to create the most appropriate and efficient work plan by analyzing the work, task distribution, and shift schedules of the personnel working on the high-speed railway (HSR) Ankara-Istanbul line. The 28 day team schedule, which aims to distribute the duties of the staff equally, includes the distribution of the teams and the creation of tours for a total of sixteen daily trips. 225 crew working between Ankara-Istanbul and Istanbul-Ankara were formed. We gathered a fair schedule for the crew, and we increased the satisfaction level of the personnel. While all this is being done, the business requests were met.