Richard Walsh, 43, was accused of attacking the two schoolboys, aged 12 and 13, in Havant, last month.
He had been in custody at Belmarsh Prison in south-east London.
Prison staff found Mr Walsh unresponsive in his cell on Sunday morning and, despite efforts to revive him, he was pronounced dead.
A Prison Service spokeswoman said: "HMP Belmarsh prisoner Richard Walsh was found unresponsive in his cell on Sunday 19 July. Staff attempted CPR but paramedics pronounced him dead at 11.07am.
"As with all deaths in custody there will be an investigation by the independent Prisons and Probation Ombudsman."
Mr Walsh, who was also charged with assault and robbery in relating to the taking of a bicycle, had been due to appear at Portsmouth Crown Court on Monday.
A man who was facing trial for the attempted murder of two boys who were stabbed in a street in Hampshire has been found dead in his prison cell.