Functional safety of railway systems