There is an old debate on whether one can exhibit courage when acting in an unjust cause. I used to think that one can. But now that seems obviously wrong, given that courage is a mean between defect and excess of daring:
Needlessly braving danger is not courageous.
Unjust actions are needless.
So, unjustly braving danger is not courageous.
Perhaps one might object to 2, on the grounds that unjust actions might be needed for some good. But one does need to do them, since no one needs to achieve the good at the expense of unjustice.
One can also vary the above argument into an a fortiori one: If braving danger pointlessly is not courageous, then a fortiori braving danger for the sake of an unjust goal is not courageous.
All that said suggests, however, that the traditional term “foolhardiness” for excess of daring isn’t quite right. For we wouldn’t call every unjust person who acts daringly for the unjust end “foolhardy”. I guess the person who acts daringly for an unjust end is worse than foolhardy: the foolhardy person’s end is good but not sufficient to justify braving the danger, while when the end is unjust, it is not only not sufficient to justify braving the danger, but it is sufficient to justify not braving the danger.