The modern sense of the expression seems to derive from J. R. R. Tolkien, who used it in The Lord of the Rings to refer to the long struggle against the evil forces of Morgoth and, later, of Sauron. Lady Galadriel, recollecting the role she and Celeborn have played in this fight, says to the hobbit Frodo Baggins: "For the Lord of the Galadrim is accounted the wisest of the Elves of Middle-earth, and a giver of gifts beyond the power of kings. He has dwelt in the West since the days of dawn, and I have dwelt with him years uncounted; for ere the fall of Nargothrond or Gondolin I passed over the mountains, and together through ages of the world we have fought the long defeat. The phrase reflects one of the major underlying themes of The Lord of the Rings, that "no victory is complete, that evil rises again, and that even victory brings loss.
In accordance with his strong Christian beliefs, Tolkien saw this phrase as applicable to all of human existence, which had been tainted by Original Sin since the Fall of Man, and would remain so until the Second Coming. He stated in a letter: "Actually, I am a Christian, and indeed a Roman Catholic, so that I do not expect 'history' to be anything but a 'long defeat' - though it contains (and in a legend may contain more clearly and movingly) some samples or glimpses of final victory.
This usage was popularized in the book Mountains Beyond Mountains by Tracy Kidder. This book describes the efforts of Dr. Paul Farmer, who selflessly serves the poorest of the poor in a medical facilities in Haiti and other poor countries.
In the book, Dr. Farmer (who was fond of The Lord of the Rings from an early age) explains to the author:
I have fought the long defeat and brought other people on to fight the long defeat, and I’m not going to stop because we keep losing. Now I actually think sometimes we may win. I don’t dislike victory.... We want to be on the winning team, but at the risk of turning our backs on the losers, no, it’s not worth it. So you fight the long defeat.
While this may sound defeatist, when used in this way, the term implies to those who use it that since the battle appears hopeless, any progress, or even a single life saved, can be viewed as a victory.
The band "Choose Your Own Adventure" released a CD in 2005 titled The Long Defeat.