Yes, “fighting a losing battle” is a metaphor—a form of figurative language. It compares a futile struggle to a battle already lost, conveying hopelessness without literal warfare.