We've seen a lot of video games that integrate both of your solutions. They have a storyline you play through (railroad) but they adjust the difficulty and/or gameplay based on how the user plays.
I'm not a big fan of this because they tend to be too forgiving or not challenging enough. Older games were hard which made beating them rewarding. Games tend to be much easier now. Even if they adjust their difficulty it usually errs on the side of avoiding frustration for more casual gamer enjoyment.
I didn't mean to imply that there was a hard line between railroading and complete freedom. The best games are probably a blend of both, offering some controlled story experiences and some freedom to explore and discover. Perhaps unsurprisingly, my favorite video games include The Elder Scrolls series and Vogel's work.
It is tricky to balance difficulty. To again draw parallels between tabletop and video games: if the players get a powerful weapon at too low a level, it can wreck the fun of the adventure because there's no more challenge. The unfun solution (in my opinion) is to take away the weapon or in some way punish the players. Instead, a good GM offers new challenges that keep the weapon relevant.
Dark Souls has a good example of this. You can get a powerful sword fairly early which makes the first third or so of the game a bit easier. But it doesn't ruin the game or anything, because the challenge is still there and the later parts of the game scale beyond that weapon.
Dark Souls in general is an interesting example of a game that has several linear structures in it's gameplay, but still feels open and rewarding to explore. In many ways, what you explore most is your own ability to best the game and better master the environment, rather than exploring the environment itself.
I'm not a big fan of this because they tend to be too forgiving or not challenging enough. Older games were hard which made beating them rewarding. Games tend to be much easier now. Even if they adjust their difficulty it usually errs on the side of avoiding frustration for more casual gamer enjoyment.