Adio Adeshine also allegedly exposed himself and pushed into the mourners from behind
Adio Adeshine, 19, allegedly exposed himself and pushed into the mourners from behind, as they waited in line at Victoria Tower Gardens on Wednesday after Westminster Hall opened its doors to the public.
He is said to have gone into the River Thames in an attempt to evade police before coming out and being arrested.
Adeshine was remanded in custody on Friday after appearing at Westminster Magistrates' Court charged with two counts of sexual assault and two counts of breaching a sexual harm prevention order.
Wearing a grey prison-issue tracksuit, he spoke to confirm his name, date of birth and address in Walworth, south-east London, before pleading not guilty to the charges.
Outlining the allegations, prosecutor Alex Adowale, said: "The defendant was part of the queue to see the resting in state of Queen Elizabeth II."
His alleged victims are said to have been among the thousands of people who have been lining the banks of the River Thames to view the Queen's coffin.
The court heard the first complainant allegedly noticed Adeshine because she had not previously seen him, despite having waited in the queue with the same people for hours.
She is said to have noticed him getting closer to her before feeling something touching her back, then turned to see he had exposed himself.
The woman later allegedly saw Adeshine acting in a similar way towards another woman, before security were alerted and police called.
He is said to have thrown his phone into the Thames before entering the water himself, but was arrested shortly after coming out of the river.
Deputy Chief Magistrate refused to grant Adeshine bail, remanding him in custody ahead of his next appearance at Southwark Crown Court on October 14.