Here was the scenario: The party gets in a fight. The winner of that fight gets jumped and their cash and prizes are stolen. Then the party chases down the second group of people and gets their stuff back.
"You planned all of that in advance. You were railroading us!" they whined.
"No. I wasn't." I pulled out my notes and showed them.
The Party and Group A get in a fight. Only 4 things can happen, the either the Party or Group A can win. Or they reach a stalemate and no one wins, either by flight or not starting or finishing the fight.
Next. The first group out of the area gets jumped. Those 4 options happen again.
And finally, when the loser or second people out of the first situation one catch up, you basically have the same 4 options. Win, lose or two different draws.
That's not a railroad. The players have a choice at each event they are present for and the dice can change that outcome. When the party isn't present, I pick the most viable option because I'm not stopping play to fight a combat against two NPC groups against each. When the party comes back, they get another set of choices and outcomes.
A railroad would be if I decided what was going to happen TO THE PARTY before they were granted a choice. I know where the branches are and what should happen next, but I have 4-5 different possible choices to account for in every scenario. If the party has an obvious choice of 4 items, and they come up with fifth, sixth and seventh option, I have no plan and need to fly by the seat of my pants.
I gave the kids a good example.
I had a party meet at a tavern. They were supposed to stop the evil lord's men from shaking down the peasants for money. The party chose not to do that. So, the peasants got shaken down. Then the party gave the peasants money to replace what was stolen. I didn't expect that outcome.
The next session, I decided to just re-run the whole thing. Again the party didn't bite. This went on for a bit with the peasants getting shaken down and the party replacing their lost funds.
Now the party was responsive to everything else I did in each session, but I was baffled by their lack of activity on this one point of defending the peasants. It almost rose to the level of a joke. After a few months of play, the checked back in on the peasants in the tavern.
Since they asked, I provided. This time the lord was there to get in on the fun. And the party sat there as the peasants got beatdown and robbed again. It wasn't until the lord threaten everyone and turned to exit that the whole party opened fire with crossbows. In the dark. In the back.
The explanation for this behavior was, everyone in the party and a few of the players were lawful evil. It was just their natural to use the peasants for bait to draw the evil lord out.
So when planning an adventure, you should plan for the obvious. What if the party wins? What if they lose? What if they run? What if they won't or don't fight? If you have those few things down, then the adventure probably won't go off the track, but if it does, the DM is only scrambling for a few seconds and not moment to moment. Which reduces the possibility of railroading the players.