I had something similar happen to be on the tube in london. My ticket got demagnetised (combined intercity rail with travel card are/were still magnetic stripe tickets) and there were not staff at the station so I could not get the barrier open to leave.