A Maryland appeals court restored a $300,000 jury award yesterday to a Montgomery County girl who was sexually assaulted by 20 to 25 fellow students at a junior high school four years ago.

The girl, who was 13 at the time, was fondled and violently molested by the youths after going into the boys locker room at her school. She subsequently left school and became a drug addict and prostitute, her lawyer said, but has since recovered and is attending school.

Last December, a Montgomery County jury awarded the girl $300,000, to be paid by the county school system and a gym teacher, but Circuit Court Judge James McAuliffe overturned the verdict, saying the girl's negligence had contributed to the incident. He noted that she broke school rules by going into the locker room and said she should have known of the risks because she had been sexually active, had been raped a few months before the incident and was highly intelligent.

"Does a 13-year-old female who impermissibly enters a boys locker room subject herself to a sexual assault?" the Maryland Court of Special Appeals judges asked in their opinion yesterday. The court said the girl had no obligation to anticipate she would be sexually molested during a visit to the locker room.