Not if we also develop technical abilities before the invasion. Here though you could make an argument that it would be much more effective if we cooperated instead of fighting.
> I think it's absurd to justify killing one another in wars because it might one day save us from some hypothetical invasion.
Well, the modern western moral system holds human life as the highest value. But even nowadays we still have moral systems that place the existence of a group much above the existence of an individual. Imagine that the whole humanity is like an organism - you don't really care about individual cells in your body, do you? A vaccination hurts, but ultimately, it leaves you stronger, right?
I'd say, "let's keep killing each other in wars so that we can maybe defend ourselves in a hypothetical alien invasion" is indeed absurd, but the general idea "wars allow humanity as a whole to practice self-defense" isn't. Europeans didn't die from native American diseases because millions of Europeans had already died in the past from similar diseases, building the collective immunity.