Sydney teenagers are breaking into locked train cabins and risking serious injury by hanging from the trains.