fight a losing battle vs tilt at windmills

fight a losing battle

verb
  • To try to do something so difficult that it will probably end in failure. 

  • To continue to wage war when it is clear that one is not going to win. 

tilt at windmills

verb
  • To go on a wild-goose chase; to persistently engage in a futile activity. 

  • To attack imaginary enemies. 

How often have the words fight a losing battle and tilt at windmills occurred in a corpus of books? (source: Google Ngram Viewer )