The paper proposes the solutions for applying the embedded devices, unmanned aerial vehicles (UAV) and control algorithms to minimize the risk of train collision with different obstacles on the tracks. With the increasing of the railway transport flow, the number of collisions is growing. The obstacles on the tracks are caused by different weather, human and other factors, but the negative effect of collisions with such obstacles and consequences is definitely proved. Thus, the main goal of the research is to investigate and develop the algorithms for railway transport control and detection of obstacles using UAV on the way of the train. The research is based on previous scientific and technical results. It includes the analysis of existing railway transport safety, satellite navigation and observation systems, the development of the improved train anti-collision system, including mathematical models, multiple criteria risk assessment function, algorithms of object detection for UAV, simulation models and prototypes for anti-collision task.