That's called "Sparring". Males do this more often, but with barbs the females will spar with each other too. Who knows what this particular sparring match was over, but it could be for who gets priority over food, choice of mate, a particular spot in the tank etc. Or they could just be bored and feel the need for some physical activity!
Nonetheless interesting behaviour, you may be able to figure out your shoals hierarchy through further observation. Nice fish!