A man accused of groping four adolescent boys on Melbourne trains late last month was coming to terms with his bisexuality and experimenting, a court has heard.

Michael Houston, 26, of Glen Waverly, is charged with four counts of committing an indecent act with a child under 16. He is accused of indecently assaulting the boys between May 19 and May 31 when all four were dressed in school uniform.

The Melbourne Magistrates Court heard all of his alleged attacks happened between 3.45pm and 4.15pm.

Detective Senior Constable Mark Sontag, in opposing bail, said three of the boys were assaulted while on trams or trains and the other boy was assaulted in the Vermont South when Houston approached him under the guise of asking for directions.

Senior Constable Sontag said each of the assaults occurred while the boys were clothed.