Railways are a high-capacity mode of transport that, when used well, can help tremendously in reducing commute time. Like highways, railroads can't take sharp turns and must form a soft curve. They can cross each other, as well as other roads in the game, forming a railroad crossing (or, in the case of the highway, passing under it). Stations must be used to get people to board railways.
However, railways are also used by your industries to get freight out of the city. If the railroad goes right through the industrial zone the factories will use the railroad directly, otherwise you need to build a station.
Passenger train station
Passenger train stations are used so your Sims can board a train and ride to another station. Sims can either walk to the station or take their car and park at the station, making them very useful for commuting. Preferably, your passenger train station should be used in conjunction with another form of mass transit, like bus stops, so Sims can change easily.
Freight train station
The freight train station is used by your factories to get freight out of the city. Place them in your industrial areas.