"I'M just glad it's all over," Ben Kooy said as he left court yesterday, minutes after allegations he had raped a woman in a Sydney train station toilet were thrown out.

Kooy, 34, was charged last Wednesday with having sex without consent with a 17-year-old at Strathfield, with the claims spreading fear among female commuters and raising concerns about transit officer numbers, which have been cut by half.

On Sunday he was freed on bail because of a "significant" change to the police case against him.

Yesterday, at Burwood Local Court, the charge was officially withdrawn.

Outside court he said he was "relieved" and the ordeal had been "very stressful".

But he had to wait for his freedom yesterday, appearing twice before Magistrate Chris Longley. Investigators spoke to Mr Kooy between hearings. It is understood they were waiting for a call from the girl, who originally claimed she was forced off the train and into the downstairs ­toilet, before police formally dropped the case.

During the first appearance yesterday, his legal aid lawyer Patricia Lyden said the "situation had changed dramatically" when Mr Longley asked why bail hadn't been applied for earlier.

Just before the lunch break Mr Kooy's matter was reheard briefly and the court was told police were withdrawing the charge and an accompanying apprehended violence order.

Police said on Thursday that CCTV footage from the station and the Waratah train the pair had ridden ­together from Redfern had led to Mr Kooy's arrest.

It is understood a further review of that footage led to the dropping of the case after it didn't support the girl's version of events.

A police spokeswoman said investigations into the matter were ongoing and wouldn't confirm if the girl would be charged with making false representations.

Mr Kooy spent four nights in Silverwater jail, ­describing his time behind bars as "awful".