This article discusses the structure and functions of an on-board automatic driving systems for a railway rolling stock. It analyzes the history of the development of such systems, their structural and functional scheme. It is shown that modern automatic driving systems are two-contour and include a speed and time control and a program unit. The problem of synthesis of such a system lies in the choice of structure and algorithms of its units. The paper considers a formal statement of the search for an optimal control of train movement. It describes the main methods of its solution — based on the classical calculus of variations, maximum principle, dynamic programming and some of its solutions. It presents the graph of permissible switching optimal modes of conducting a train. The paper indicates that in spite of the numerous studies in this area, the problem of optimal control train traffic has not been solved completely.