The three track runners at Bronx HS of Science accused of viciously hazing a freshman teammate yukked it up outside their Bronx court appearance yesterday — before getting slapped with orders of protection.

The trio — 16-year-olds Thomas Brady and Boubacar Diallo and 17-year-old Pier Bermans — got somber and serious once inside Bronx Criminal Court, where they faced charges that included assault and forcible touching of their schoolmate’s genitals.

The alleged attacks — which included threatening the 15-year-old victim with rape inside the boys’ locker room — took place from late December 2012 through Feb. 25, according to the victim’s statements to authorities.

“Other than contact at school, there is to be no other contact with the complainant. Do you understand?” a scolding Judge Jeanette Rodriguez-Morick told the teens.

“You are not to call, text or e-mail him.”

Only Brady answered, “Yes Ma’am,” as the other teens nodded their heads, appearing nervous and clasping their hands behind their backs.

None of the kids’ parents would comment; a lawyer for Diallo noted that the teens were minors.

“I can only ask, how would you feel if you were [charged with] these allegations?” said lawyer Angel Cruz. “The only thing they can hope for now is to clear their reputation . . . This is something that they aren’t accustomed to.”

The next court date was set for April 23.

Officials at Bronx Science acknowledged a similar incident of forcible touching involving the track team in 2010, but have otherwise insisted that the alleged actions are out of character for kids at the high-performing school.