According to local security officials, the militants were caught by villagers of Farghmanj in Jorm district on Monday.
The officials furhter added that the militants were initially disarmed by villagers and were then beaten.
Deputy provincial governor Gul Mohammad Bidar said they are aware of the incident involving a number of Taliban militants sexually abusing cows.
He said the local residents have launched a demonstration agains the Taliban militants for committing such a shameful act.
According to Bidar, the two militants have managed to flee the area and have gone to another place under the control of Taliban militants.