I hear people complain about railroading all of the time. Sometimes I even hear players complain about railroading when it's accepted railroading. That's just as bad as a DM that executes bad railroading. Those are the players that feel like their 4-8 hour gametime is precious & the DM needs to cater to their needs. If they want to explore area B rather than area A, then gosh darn it, the DM better be good enough to wing an entire session & forget about the 15 hours he spent preparing stuff for the last 2 weeks.
The thing that some people don't realize is that there's different versions of railroading. I'll give a few examples using this scenario: The objective of the plot is to stop the BBEG from feeding the King to the Red Dragon at the end of the adventure.
Example of accepted railroading:
A DM with little time on his hands only runs published adventures. The adventure hook is to get the PC's to travel through the haunted forest which will allow them to find the underground caverns that lead to the Red Dragon lair. Instead of following hooks to get PC's travelling through the forest, the PC's say they want to sneak into the castle and assassinate the king. The DM hasn't created floorplanes to the castle, hasn't created stats for NPC guards, & doesn't even have stats for the king. But he does have floorplans to a cave, stats to the BBEG, & a creative plotline that he paid $15 for on Ebay. So every attempt the PC's make to sneak into the castle is foiled & they keep hearing about ghosts in the haunted woods. So the players might say, "We're being railroaded into going into the woods".
By letting this guy DM, the players have agreed to a gentlemans agreement. For the sake of getting to play D&D, they agreed to play out whatever adventure this DM provides them since he can't free-style a session. If this is made clear before the game, players should attempt to follow obvious hooks so the DM can hopefully absorb them into a fun adventure. There's nothing wrong with this & no one should complain about this accepted railroading unless you're a "problem player".
Example of bad railroading:
This same DM just finished running an undead encounter in the forest & a woman they rescued points to a cave entrance & tells the PC's that the BBEG kidnapped the king and took him in there. The PC's want to go back to town to by +1 swords so they can kill the BBEG easier. The DM doesn't want them to do this so he tells the players they get lost in the woods...but they find the cave again. When the PC's attempt to go to town again, the DM says that a Red Dragon flies overhead but doesn't notice anyone yet (he hopes the PC's will hide in the cave). The PC's hide in the cave and the DM tells them that they trigger a trap and the cave entrance crashes down & bolders now block their way out. So the players might say, "We're being railroaded into going into the cave & not going to town".
Rather than letting the PC's better equip themselves, he blocks their attempt by throwing obstacles at them that keep thwarting their actions. The players feel like no matter what they do, something will happen to keep them from going back to town. The DM doesn't have any reason to railroad this other than the fact he just didn't want them to buy +1 swords, & he wants to hurry & get to the cave encounters.
Example of illusion railroading:
The adventure says that PC's need to find the Dwarf Miner in the cave so he can guide them through the correct tunnels or the PC's could get lost forever underground since they don't have a Ranger PC. If the PC's want to continue playing, they'll need a guide. When they meet the Dwarf, they dislike him & kill him before they find out he can guide them. As they continue on, the DM creates another Dwarf & comes up with the idea that he was actually searching for the 'now dead' Dwarf in order to hurt him for stealing his mining job. The PC's run into this 2nd Dwarf & lie to him that they saw the other dwarf die by a trap. They get along with this Dwarf & the new Dwarf tells the PC's he can guide them through the caves. They accept his offer & never realized that they were just railroaded into following an NPC guide through the caves.
The group was not equipped with a way for them to get through the caves & they ruined their only chance without knowing it. The DM needed to nudge them forward so the game doesn't come to a halt. He guided the PC's in the right direction without them knowing.