More people die in rail-related incidents in California than in any other state, and officials say most of those deaths are preventable.

Bay Area rail agencies gathered Wednesday at Diridon Station in San Jose to raise awareness about railroad safety and dangerous behavior around crossings.

Representatives from Union Pacific, VTA, Caltrain, Amtrak, Capitol Corridor and other agencies displayed safety equipment and handed out educational materials as part of the safety effort.

NBC Bay Area got a firsthand look at some of those dangers during a ride aboard a Union Pacific locomotive.

Before boarding the locomotive, NBC Bay Area saw one driver stopped on the tracks and others stopped too close to the rails.

From inside the conductor’s cab, a person was seen jogging around lowered crossing gates while warning alarms were sounding.

Unhoused people were also seen camping and walking within feet of the tracks. Other drivers were seen making unsafe U-turns rather than waiting for the crossing gates to rise.

Between 2020 and 2024, 593 people died in rail-related incidents in California, according to the latest available statistics.

California also accounts for 24% of trespassing deaths, the highest percentage in the nation.

According to the Federal Railroad Administration, 94% of deaths are caused by risky driver behavior.