The challenge isn't finding counter examples, it's limiting the narrative of history to have a simple "good/bad divide" but here are some selections of underdogs one may consider the greater of two evils:
- The confederacy (US Civil War)
- Caesar's army crossing the Rubicon
- Imperial Japan post Pearl Harbor
- Pakistan's complicated history with India
- King Leonidas and his men (Persia was arguably more equitable)
- Austria-Hungary (WW1)
- Fascist Italy (WW2)
As for David and Goliath, keep in mind David was using a sling, a weapon that can hit with the same force as a modern revolver when used properly. It's entirely possible that story is an allegory and/or propaganda of the value of properly equipping one's armies; it probably shouldn't be viewed as anymore impressive than a rampage killer fatally wounding somebody twice their size