Level crossing accidents are among the most common accidents in rail transport. Accidents between trains and pedestrians often end in serious injury or death. Several key factors contributing to the occurrence of train-pedestrian accidents are human error (violation of laws), poor visibility, inadequate infrastructure, etc. One of the aims of this study is to analyse the problem of frequent illegal pedestrian and cyclist crossings at the Trnava level crossing in Croatia. Data was collected through observations and camera recordings of illegal pedestrian and cyclist crossings (traffic violations). Frequent train traffic on the double-track international and suburban railway line M102 (Zagreb Glavni kolodvor - Dugo Selo) leads to long closing times of the level crossing. The problem is exacerbated by the high volume of pedestrian and cyclist traffic, which makes the Trnava level crossing a high-risk location for accidents. Data collected on site (at the Trnava level crossing) is used to create a simulation of a pedestrian and cyclist underpass using PTV Vissim software and to investigate the effectiveness of the underpass as a solution to reduce risky behaviour by level crossing users at the Trnava level crossing. The result of implementing of the underpass for pedestrians and cyclists is a complete separation of non-motorised traffic and rail traffic, which significantly reduces traffic violations and insures safe movement of level crossing users.