Rail-trespassing crashes that involve various levels of injuries to pedestrians are under-researched. Rail trespassing could occur at crossings where pedestrians are present at the wrong time and at non-crossings where pedestrians are not legally allowed to be present. This paper presents a comparative study examining rail-trespassing crashes in two contexts: highway-rail grade crossings vs. non-crossings. How pre-crash trespassing behaviors and other factors (e.g., crash time, locations, and socio-demographics) differ between grade crossings and non-crossings are explored. The analysis relies on a ten-year (2006–2015) database of rail-pedestrian trespassing crash records extracted from a Federal Railroad Administration safety database. Of these 7157 rail-pedestrian trespassing crashes, 6236 (87%) occurred at non-crossings, while 921 (13%) occurred at grade crossings. About 60% of the crashes were fatal at both crossings and non-crossings. The most prevalent pre-crash trespassing behavior is running or walking, 63% at grade crossings and 44% at non-crossings. Lying or sleeping account for 29% of non-crossing crashes, whereas they are 3.6% at grade crossings. A unique aspect of the study is that a diverse set of variables based on geographic variations across counties along with crash or injury data are modeled. Considering the data structure and heterogeneity that may exist due to unobserved factors, the multilevel mixed-effect ordered logistic regressions models are estimated. The results show that the correlates of injury severity differ across highway-rail grade crossings and non-crossings. For example, lying or sleeping on or near tracks contributed to higher chances of fatal injury in both contexts, however, they were relatively more injurious at grade crossings. The analytical results can provide guidance on railway safety improvement plans.