The "sandbox" v. "railroad" dichotomy is a false one (as are most comparisons in the gaming world). The world does not exist of it's own accord, it functions only to the extent that it has been designed to. A "true" sandbox is reality, since a TTRPG cannot fully simulate reality, it cannot be a true sandbox.
I disagree. There is a very real dichotomy, and both of them do exist at endpoints of a spectrum. But both are extreme, radical approaches to the game. There's no such thing as a good/bad dichotomy; because both are so extreme as to automatically be bad games to the vast majority of most players. Luckily, few games really are "true" sandboxes or "true" railroads, since "true" examples of each are sort of like Platonic ideals, not something that you really see in real life. As games approach too near to either endpoint, however, they start to exhibit the problems inherent in either approach.
I also think it's fallacious to refer to adventures as sandboxes or railroads. Adventures can be written with a sort of assumption of a more sandboxy or more railroady approach, but in reality, the sandbox/railroad dichotomy really only makes sense when describing GM behavior at the table, not what's written in the adventure. An adventure written with the assumption that the GM will railroad the players from point A to point E with points B, C, and D along the way can still play out as a sandbox if the GM fails to give enough meaningful feedback to the players that they can "find the game" and they end up wandering around either ignoring the adventure or doing something else entirely, or whatever. And the most sandboxy game supplement in existence can be a railroad if the GM fails to allow the players do succeed at anything other than what he already had in mind for them to do.
For my money, I prefer to sketch an outline of what I expect a few sessions will look like. I make plans for points A, B, C, and D. I give my players plenty of plot hooks. I often give them competing plot hooks, so they have meaningful decisions to make on what they think sounds most interesting. And I'm more than happy to indulge them if they think of something else that they may want to check out, and if it leads to points X, Y and Z that I totally did not plan in advance, that's totally fine too. To me, that's taking some advantages of both approaches without indulging in their weaknesses if you run the game at either extreme.
However, I also treat the setting somewhat like a character. If--to use an obvious example--the PCs decide in the middle of a dungeon that they're tired of it and want to quit, they don't get a magical "teleport back to town" option. They have to actually
leave the dungeon. If they've been down their for a while causing trouble and making noise, then that might be easier said than done. A lot of sandbox fanatics will call that railroading on my part. In my opinion, this characterization is absurd. Sandbox does not mean that logical consequences don't follow the actions of the PCs. If the PCs make a powerful enemy
by their own actions and their own choices, that enemy might well attempt to thwart them, have them assassinated, put out a bounty on their heads, etc. This will in turn limit some of the options that might have been open to them had they not made an enemy of that NPC. But that's just the logical consequences of the choices that they made. That's not a railroad, that's just common sense.
By the same token, the world doesn't just sit around static. In a computer RPG, if you talk to an NPC in town and he says something to you, he usually ends up just sitting there indefinitely and says the same thing to you again if you come back to his area and talk to him again. In my games, if the PCs elect to follow a plot hook that they find interesting, something may well be happening with the plot hook that they ignored. If they decide to go look for treasure in the Old Forest and ignore the hints that orcs are brewing in the Black Hills, they may come back to town with their treasure only to find that the town has been razed to the ground and most of the inhabitants dragged into slavery, or left to rot in ruins of the streets.
I strongly believe in giving the players their heads to go drive the adventure that they want to have. But I also strongly believe that most players aren't motivated to make adventure out of nothing, and prefer to have rather obvious hooks to pursue. This is especially true early in the game, when they don't yet have much of a connection to the game world, to each other, or even to their own characters yet, and need a bit of a heavier hand until such time as they can develop those traits. I don't really worry about trying to label my games as sandbox or railroad either one, because to me, both are pejorative.
I also find that rah-rah sandbox type players raise a lot of red-flags with regards to the implicit social contract. Sure, it's nice to have players who are ambitious enough to take on the game and really engage with it. But that can also easily turn into spotlight hogging and pushy/bossy behavior that alienates or aggravates the other players.
Like I said, both approaches have things to recommend them. Both of them "unbridled" would be disasters from my perspective. The trick is to walk a line somewhere between them, giving the PCs both enough direction and enough freedom that they feel satisfied with the game.
To me, this has little to do with how an adventure is written.