A man was filmed touching the butt of a woman on a train, but was startled when he realised he was caught on camera.