You will not be under arrest, and you are free to leave at any point, but if you fail to provide a valid name and address to an officer of the railway, it is a criminal offence.