Hi and welcome to OSM and the forum

Yes, it is possible. OSM is an open database. That’s what it’s made for. :slight_smile:

How? That depends on what you want to accomplish and how you define “train routes”. Have a look at https://wiki.openstreetmap.org/wiki/Downloading_data . In general there a two options: Use an online API to query the database directly to get data or download an OSM-File and extract the desired information from there (offline).