At the opening of the trial, prosecutor Shawn Williams said the defendants, who each appeared in the dock assisted by their own interpreter, were unaccompanied child asylum seekers.
Jahanzeb fled Afghanistan and underwent an age assessment after arriving in the UK in January, which concluded he was 17, Mr Williams said.
Niazal arrived in November last year. He was initially accommodated in Kent before being moved into local authority care in the Warwickshire area.
The rape, which took place after the victim became separated from friends on a grassed area, was described as “horrific” during legal submissions regarding reporting restrictions.
Mr Williams told the court that video evidence showed Jahanzeb with the victim and speaking in Pashto – the official language of Afghanistan – to summon Niazal to join him.
Footage from a mobile phone recovered by the police was highly distressing, Mr Williams said, adding that the victim had screamed for help but Jahanzeb had placed his hand over her mouth.
He said Jahanzeb and Niazal led the highly distressed victim into a “den-type” area in parkland in Leamington Spa where they attacked her.
The victim had repeatedly shouted for Jahanzeb to let go of her as she was led away.
She was later assisted by a member of the public who advised her to contact the police and stayed with her until she was safe.