This is not rival and this is not president. Librarian cannot win alone.
https://epicmafia.com/game/5646580https://epicmafia.com/game/5646590hmm, if you can replicate this in a smaller game, lemme know
That doesn't explain how the game still went on after everyone died, though. ???
Maybe librarian doesn't count towards mafia's outnumbering total?
My best guess is that the logic goes something like mafia wins if president dies and a villager is alive as opposed to mafia wins if president dies and a villager is in game.
Game should've been finished with mafia win upon president getting lynched and mafia outnumbering, but it didn't happen.