The Eitz Yosef in the new Moznayim print of Medrash Rabba in Bereishis 61 does say that they died `in one period between Pesach and Atzeres in milchamas beitar'. He makes a similar statement in Koheles Rabba 11, saying they died in Bar Kuzivas war. These lines were previously censored out.
It is questionable though, how to reconcile this historically in light of the medrashim that detail the fall of Beitar on the ninth of Av. We know Bar Cochba had a trained army and was catching bombardment and sending them back so apparently there was engagement before the wall was breached.
In support of assuming they died in a war against Rome is the Gemara having said they died of Askara, a type of asphyxiation. Although this is sometimes viewed as a question on this approach, I recently became aware that this would actually fit very well within the understanding of how the Roman method of crucifixion killed it's victims, often political prisoners, in the thousands at a time.
(see this link)
"Without any supplementary body support, the victim would die from muscular spasms and asphyxia in a very short time, certainly within two or three hours. Shortly after being raised on the cross, breathing would become difficult; to get his breath, the victim would attempt to draw himself up on his arms. Initially he would be able to hold himself up for 30 to 60 seconds, but this movement would quickly become increasingly difficult. As he became weaker, the victim would be unable to pull himself up and death would ensue within a few hours."
What always caught my attention with this approach is that every day when we bentch and say the bracha of hatov vihameitiv which was nisaken on the Harugei Beitar who didn't rot and were buried, we are commemorating the students of Rabbi Akiva among them. Way to bring tisha b'av, sefira, and birchas hamazon all together!