hair yes, red, not really
If the hair algae you have is the black, slightly curly, looks a lot like nasty armpit hair then the rosy barbs will indeed eat this, happily, vigorously, in fact. It took a pair of rosy barbs about 2 hours to clean up 90% of the hair algae in my tank, by the next day I think it was all gone.
I saw them working on the red algae (not red in my tank but a strange bluegreen except when it is bleached it turns pink as it dies) but I cannot say they ever made a dent in that stuff. The Amano shrimp do more on that, and keeping the CO2 levels up by dropping the HOB filter and going with a canister has slowly helped, but still it hangs on.
So, yes on the hair algae, but no for the red algae.
Note that they will nip at plants, even the sorts that people claim that fish don't eat, like java fern and anubias nana. They've nipped at apongeton ulvaceus, and melon swords, really I don't think there is anything they won't nip at. The babies are worse than the parents for some reason. It is the fresh growth that is most at risk. So, don't get too many of these guys, one may be enough.
And they are PIGS, they will bully the cory out of his food. I'm amazed they haven't eaten the Amano shrimp yet, they cleaned out the ghost shrimp in minutes.