The purpose of this research is to prevent crashes on level-crossing and to develop a new wireless anti-collision system for railway and road vehicles based on embedded devices in addition to existing wired and light signalization and to existing braking systems of the trains. The research is based on authors’ previous scientific work researching the intelligent railway device systems, which use satellite navigation systems, wireless communication networks and artificial intelligence, have possibility for machine-to-machine negotiation between each other and to coordination of their work to improve safety. In current work authors propose the research and development of the specific modular fitness function and improved evolutionary algorithm for faster work in networks of embedded devices. The proposed system is using satellite navigation system, embedded sensors and wireless communication. Mathematical models, algorithms and computer models are developed. The results of simulation of proposed level-crossing anti-collision system show the possibility to avoid crashes, detect and warn about dangerous conflict points and react immediately. As a result of research the experimental prototype of the anti-collision device for safe passing of motor vehicle over level crossings using satellite navigation systems is created and tested. The device is supported by Patents WO/2013/013728, WO/2011/115466.