Like most things in this universe, "railroad" has fuzzy boarders. So we can talk about more railroad or less railroad. We can even put a line that labels stuff on one side as "railroad" and stuff on the other as "not", but that line
isn't interesting and is a lot of work to paint.
A plot is "more on rails" when player "story" choices have less impact.
If there is only 1 way to solve a problem? More rails.
If every path leads to the same encounter? More rails.
If there are 3 paths, with different content, that lead to the same destination? Less rails than above.
If the world is broken into medium-sized pieces, and the content in each medium sized piece is uniform? Less rails than above.
If the DM creates 1 BBEG and the game is going to be about fighting that BBEG in a way that the players choose? Some rails. Less rails if there are multiple BBEG and you let the player's actions pick which ones they want to confront.
You can have rails hidden by illusions, like illusionary choice. Sometimes this is merely about saving effort; suppose you have an encounter set up where bandits attack a caravan in an forest. And the players bypass the forest. Later, they do go through a forest; using that bandit encounter
there can be an example of saving effort. It is also an illusion hiding some rails; the "forest bandit ambush" teleported around depending on what the players did.
All rails are a way of restricting the impact that player choice has on the game's narrative.
A "game on a railroad" refers to a game where the rails are
everywhere. You can talk about a branching railroad (which is less on rails), so having 3 paths to the end of the adventure doesn't mean the game isn't on rails. It means that the rails are less constrained.
As the world is an expression of the DM's design, even something as simple as a linear cave system or mountain pass are rails. The rails are stronger if you say "no, you can't burrow around it", and weaker if you could. Dungeons are full of rails as well.
A forest, where there are camps and creatures in fixed locations, and treasure/rewards, isn't rails. It is a location with stuff in it. The players are free to interact with it or not as they choose.
That forest put in a narrow pass that the players must to through in order to reach a destination is more rails-y.
That same forest, where you can walk around it, is less rails-y.
The more you build a world, and the less you build a plot, the less rail-y things tend to get.
If you want a plot with less rails, give the bad guys a plot and set of steps they will follow. Expose those actions and steps somehow to the PCs and let them do whatever they want about it.
Suppose you wanted a story about a Dracolich attempting to kill a god and ascend. That is your BBEG.
A rails-y way to do it is to describe what the players do in order to defeat the Dracolich.
A less rails-y way to do it is to set up a track for that the Dracolich will do if not interfered with (a plot for the Dracolich).
Then populate the area with adventure hooks and things to do and treasure to find when following those hooks.
Then connect some of those things/treasures/hooks back to the Dracolich's plot, so that following those hooks/getting that treasure/doing those things exposes the players to the Dracolich's actions.
Have those connections get more and more obvious as the Dracolich's plot matures; (never underestimate player cluelessness).
If you feel generous, you can even arrange for increasingly difficult ways to disrupt the Dracolich's plot, connected to increasingly dangerous local adventure hooks, so if players do notice the plot "early" they don't get smacked down and killed by a surprise Dracolich.
Players
never have to follow the bait you have placed. If they are having fun, you keep at it. If they get bored and ask out-of-game, you can drop a hint about one of the hints you gave (or make hints more blatant).
Here, I have
planned for the players to do a myriad of things, and dangled a story in front of them if they want it. But I also planned just as hard (if not harder) for what happens if they don't take my bait, and ensured that the story that results
doesn't suck.
If they ignore the Dracolich completely, the story is that the Dracolich creates a massive death zone and blight, kills a god, and ascends. These things happen. That dead zone looks like a fun adventure hook!