In my mind there are two forms of the "railroad". The first is fairly common and not always a horrific thing, the second is insidious and can destroy a campaign without anyone even knowing why.
The first is the plot railroad. In this the characters are driven to follow the main plotline that the DM has set up. They are characterized by the fact there is series of events that need to happen in order to move the plot along. Depending on the DM, sometimes the characters will be allowed to wander off and do their own things, but eventually the characters will be drawn back into the plot. There have been numerous articles throughout the years giving details on how to do just that - how to get the characters back into the plot after they have gone astray.
The second is the character railroad. This is similar to the plot railroad, but in this one the characters have little choice but to follow the plotline. Whereas the plot railroad is fairly obvious, this one can be hidden by an experienced DM which makes it all the more dangerous. For example, in a pulp adventure I was reading recently, the characters give chase in cars after an adversary who is carrying a briefcase that the characters need to continue the plotline. There are rules for describing the chase, including the fact that the GM should ignore any result that allows for the adversary to escape. Basically, the players can not fail; it is preordained that no matter what die rolls they make or what happens, they will succeed. They have to succeed or the plot will derail. As another example, we have the classic 'the bad guy got away but left behind a slip of paper leading to the next encounter'. In this case there is no penalty for failure.
This is a far more dangerous form of railroad. On one hand because it so subtle (the GM can move things along from behind the scenes) it often feels as if there is no railroad. However, this form of railroad requires that no matter what the characters always succeed. Over time, the players will begin to feel as if their choices have no meaning. They will begin to resent the game, and will have no idea why they feel this way. A campaign can come to a crashing end and no one will know why.
Sometimes a DM has to have some form of a railroad in order to provide an interesting story, but a good DM will avoid the character railroad. Failure must remain an option. If the characters fail, it is still possible to remain on plot, but the next stage of the plot must be reached through an avenue outside of what the characters just failed at. In effect, instead of a character railroad, you would be implementing a plot railroad. Going back to the 'the bad guy got away but left behind a slip of paper leading to the next encounter' example. Instead of leaving behind a slip of paper, allow the characters to fail. Introduce a new element to the story to move the players to the next encounter. But never allow for plot advancement to come out of the character's failures.