Over the recent years, a number of cyberattacks on safety-critical systems, including railways has been rapidly increasing. To analyse the impact of cyberattacks on safety, we need to create methods supporting a systematic and rigorous analysis of system behavior in presence of cyber threats. In this paper, we propose an integrated methodology and automated tool support for an integrated analysis of the impact of cyberattacks on safety of railway systems. Our approach relies on graphical modelling in SysML, HAZOP-based analysis of security requirements and formal modelling in Event-B. The proposed approach allows the designers to identify and visualize the safety requirements that become violated as a result of various cyberattacks.