Nintendo survived because they had a few advantages. They had the handheld space, they still have in fact. And they have some sort of a consistent quality with iconic videogame characters suited for all ages. Mario, Zelda etc. There will always be a market for these games and Nintendo is careful about these IP where Sega kind of did whatever they felt like with Sonic (and even ignoring the IP for Saturn). On top of that, Nintendo had more financial wealth than Sega to begin with.
But yes, after the 16 bit generation Segas days were kind of numbered. Even with good management I doubt they would persist against companies like Sony and Microsoft. You can't expect Sega to pay a few billion for a studio like Bungie, or 70 billion for a publisher like Activision. Nintendo can't do this either, but they don't need to.
In fact, its not like Nintendo kept fighting spec wars either. Even they couldn't hang on. The Gamecube was their final cutting edge piece of hardware, which has been released well over 20 years ago. Spec wise GC could engage the Xbox and PS2. After that Nintendo went for innovation like motion controls. And they always had handheld to fall back to. But Nintendo simply backed off as well, what they offer is completely different from the others.