Con objeto de mejorar la calidad del servicio, aumentar la eficiencia y seguridad de la operación, y reducir los costes operativos y ambientales en los actuales sistemas de transporte ferroviario, este trabajo presenta el desarrollo del subsistema de operación automático para trenes (ATO, Automatic Train Operation). En particular, se enfoca en la capa mesoscópica, la cual hace referencia al planificador encargado de generar las señales de control a proporcionar a la capa microscópica, asociada al módulo motor. Mencionar que, aunque este desarrollo no aporta una novedad significativa, es un paso fundamental para futuras contribuciones innovadoras en esta línea de investigación. Por ello, se ha modelado el tren a partir de la dinámica longitudinal que lo caracteriza y se ha implementado un algoritmo inicial, encargado de planificar y regular la velocidad del tren hasta cumplir con las especificaciones impuestas por la capa macroscópica. La solución propuesta ha sido validada mediante simulaciones que incorporan diversas perturbaciones en la vía. El análisis de los resultados obtenidos permiten corroborar que el desarrollo cumple con el objetivo principal de manera satisfactoria, dando paso a la futura mejora del algoritmo mediante la implementación de técnicas de control inteligentes.