What is an AI?
I ask because, in situations like this, the blurryness of the line is actually quite a useful detail. To explain the blurryness, I invoke the Ship of Theseus
First, suppose that the famous ship sailed by the hero Theseus in a
great battle has been kept in a harbour as a museum piece. As the
years go by some of the wooden parts begin to rot and are replaced by
new ones. After a century or so, all of the parts have been replaced.
Is the "restored" ship still the same object as the original?
Second, suppose that each of the removed pieces were stored in a
warehouse, and after the century, technology develops to cure their
rotting and enable them to be put back together to make a ship. Is
this "reconstructed" ship the original ship? And if so, is the
restored ship in the harbour still the original ship too?
This is an age old philosophical question, which has no clear answers. However, the second case is remarkably similar to yours. You're basically packaging up the successful AIs, and rebuilding them in the harbor to send out to sea.
The interesting part of this is that it suggests that the part which matters never gets destroyed. It is always being relayed back. As such, it is actually more effective to think of this as one giant gestalt being, rather than an individual AI per mecha. The power is in that it can sacrifice a mecha and learn something about how the enemy fights.
Now what's really interesting to me is that militarizes do the same thing. One of the reasons stated for why the allies won the Pacific theater of WWII was that the Japanese would send their finest pilots out to do combat with the US. The US would rotate our finest pilots back to train up a new generation. As such, our ability to transfer knowledge was better than theirs, and in the long run the US bled down Japan's seasoned pilots and asserted air dominance.
Also of interest is the strange concept known as Espirit de Corps. This spirit is something which soldiers hold in high regard is something that is trained into them and transferred from one generation to the next. It holds onto what soldiers would consider to be the indispensable and ineffable essence which lets one excel at combat. In my opinion, this is very close in nature to what you transfer back with your AIs. You want to develop the AI equivalent of the essence of how to fight.
This is not easy, and there's lots of ways this can go wrong. But it at least frames the war in a way which lets us study how you could go about building the war.
Your opponent is not fighting a bunch of individual mecha. Your opponent is fighting a gestalt AI. How does this AI work? The devil is in the details. Your AIs have the capability to learn quickly, transferring knowledge from one mecha to another faster than humans can. But how do we know that knowledge is good? Such an army runs the risk of an opponent attacking your gestalt AI rather than the mecha. If they can "convince" the enemy mecha to all learn something uniformly, that can be used to create a weakness that can strike the entire army all at once. With humans this is harder, because we aren't uniform. We do things a little differently, so there's rarely one glaring weakness in every unit. All an opponent needs to do is study how the AI transfers knowledge, and try to exploit the little details of that.
If you try to make the AIs more unique, then you start to run into a similar issue that humans do: you can't pass information easily between AIs. You end up with unique individual AIs, each with their own personality. This ends up with a different balance. Information sharing is slowed, but you still have the long term learning process.
Now the question becomes "what do we learn?" As mentioned in other answers, one of the questions for all AIs is what is their goal function. Surprisingly, in war we find that the goals are not as obvious as we might think. There's the so called Pyrrhic victory, where one wins the battle but loses the war. The highest level goals of war are never as simple as they seem in the movies. Teaching an AI to accomplish these goals may be a very difficult challenge indeed.
Which points out a very common pattern in war: a split between strategy and tactics. One might trust AIs, born and reborn every time, to become masters of tactics while other entities (such as humans) handle the strategies to use these tactics. We see this in the division of labor in canine corps, where the dog is a master tactician and the human is permitted to focus more on the strategy of how to use the dog wisely. We also see a similar structure in the division between enlisted and officer corps, though the divisions are murkier here because all humans can do both strategy and tactics. But we do see a strong tendency to have an enlisted corps which excels more at tactics and an officer corps which excels more at strategy.
Which, interestingly enough, does indeed tend to take information back from the front lines and teach it to the next generation rather well. The result is not as extreme as being able to clone an individual who dies on the battlefield, but the process of extracting information from the battlefield is a well respected aspect of warfare which we do today.
So, in the end, the devil is in the details. You could build a world where AIs are strong enough to beat out all humans. You can build a world where AIs are less effective than humans. You can build a world where a mixture of both is necessary to excel. It all depends on how you construct your AIs, and to date we don't have any information as to how that would work. AI research just isn't that far advanced.
However, as a closing, I'd like to point out the game of Chess. Chess was always a game of warfare, so lessons we learn from Chess may reasonably be applied to the art of war. For a long time humans were the superior Chess player. In fact, for decades it was said that no computer would ever beat a human at chess. Then they started beating a few novices. Then intermediates. In the '90s, we finally saw Deep Blue beat Kasparov, the highest ranked player in the world. Nowdays, computers regularly beat humans with one virtual hand tied behind their back (such as having to host the engine on a laptop with limited endgame tables). Computers have supplanted humans as the masters of this game of warfare.
Or have they? Kasparov minted a new class of chess players in a bracket called Advanced Chess. In Advanced Chess, players may be human, computer or human-computer teams. As it turns out, the human-computer teams utterly dominate the pure human or pure computer team. The combined approach of a human's heuristic thinking with the computer's ability to completely analyze a situation wins out every time.
And, interestingly enough, if we look at how our bodies work, we see a similar pattern where our brains may provide the heuristics as to where to move, but it is the muscles which are the masters of the best way to actually go about accomplishing those goals, and acquiring the resources (such as sugars and proteins) required to do so again and again.
Food for thought.