A “dangerous sexual predator” who attacked a girl while she was on her own at a railway station has been jailed.