I think they offer very similar things. Games offer you the ability to interact, making the story at hand more your own. Books give you less information, allowing you to create the environment for yourself, but have a set story.
There are also games to teach you things (factorio definitely taught me a lot about planning, not to mention logic gates), just as books can.
The only advantage books have for me is that they don’t irradiate my eyes with as much blue light as a screen would late at night.