Survey and design of modern and safe railway systems