To lose the battle
Used both literally and figuratively. Describes failing in a particular struggle or fight, even if the overall war hasn't been lost.
We lost the battle but not the war.
He lost his battle against illness, but he fought until the end.
—How did it go? —We lost the battle in court.