All modules are railroads. There isn't a module that has been printed that doesn't depend on some cooperation from the player and which doesn't subtly or unsubtly funnel the characters along particular paths. A good module does a good job of hiding that it is a railroad, and leaves open plenty of oppurtunities for players to get off the train for a while and do thier own thing, but pretty much every module expects the players to progress through certain chokepoints in the plot. In this, they are no different from a computer role playing game adventure, only run well and written well a pen and paper adventure can hide that fact more easily.
The question is, "When is railroading bad."
A player is only being railroaded if no matter what his actions, things turn out the same. Too much linearity is bad, though linearity can often be hidden (for example in 'Sunless Citadel' you've a linear dungeon crawl and plot very cleverly disguised).
A player should never feel like a passenger on the train. So long as they feel like they are driving the train, they'll hardly notice that they are on rails. But if they feel like a passenger, it doesn't matter how many branching paths you have.
Another problem is if the DM instead of saying, "That action fails.", instead says, "You can't do that action." You pretty much should never tell a player that they aren't allowed to do something. Don't preempt their action. DM's are reactive, not proactive. The only time to be proactive is if you think the players are acting without the full information that their characters would have (say like the fact that the ravine is 150' across, and thus not jumpable). But they are allowed to try, and they are allowed to fail (hopefully gracefully). Alot of times when players do something or want to do something that derails the adventure (like kill an NPC which is important to the plot later), they panic. I know I have earlier in my career. But a decent DM should be able to rewrite an adventure on the fly, so that the players get back on the rails without ever knowing that they are. Or, if you can't, there is always a good chance that the PC's action provokes a new adventure in its own right.
Sometimes an adventure which is on rails requires a high degree of skill to hide the rails. A good example is DL1. Played with an inexperienced DM, this is terrible module. Played with an experienced DM, it is a great one. The difference is being able to let the module flow at a pace, and with the sort of detail that hides all the dead ends.
About ten years ago when I was obsessed with detail, I designed an adventure with rigid time lines of events. It seemed a good idea at the time, because it seemed fair. The world apart from the PC's would keep going on whatever the PC's did. I thought I was making the world seem more alive and more real, and I thought I was adding drama and intensity to the plot. It turned out in play however to be a really horrible idea because realism is not what you are going for as a DM. As a DM you want the PC's to solve the problem, you want them to be the heroes. That's really the only way it can turn out fun for you in the long run, and that excessive realism got in the way of that. I quickly dumped my timetables of who would be where when (unless preempted by the PC's of course) and basically changed over to what ammounted to 'cut scenes' and scripted events. The PC's can't see the big picture. A well played cut scene seems just as real and organic and spontaneous as a timeline, but the counter-intuitive thing is that even though in reality cut scenes and scripted events are actually more of a railroad than a timeline (the DM is fudging to produce the desired outcome), to the players it feels less like a railroad because they get to choose the pace of the adventure and in effect when things happen.
In other words, they don't feel like a passenger or an observer. And avoiding that feeling is all you need to do to avoid railroading the players.