I think you're looking for J. R. R. Tolkien's concept of "the long defeat", the notion that even though the battle—and indeed the war—seems hopeless, one should fight to the bitter end anyway, to hold out as long as possible.
“Ever-Defeated Never Altogether Subdued”: Fighting the Long Defeat in Tolkien's The Lord of the Rings and [Joss] Whedon's Angel