they usually use the same rail line, well at least thats the case in canada.
freight trains have priority over passenger trains believe it or not.
but usually rail lines are titled CP canadian pacific CN canadian national, so thats how you know if they are freight rails because they are owned by CP or CN.
and its good to know where you are going before you get on a freight train, that way you can plan ahead and look at the railway line on the map and figure out where a corner is or a town because trains usually slow down to take a corner or when entering towns. thats how i got on the train in my town, it needs to go over a bridge then take a corner which then the train enters the town, so where my uni is it slows down just enough towards the back of the train that i can hop on.
but personally i think jumping on the very last car of the train is probably the safest. because if you fuck up you only have to worry about that one car, since there are no more behind it.