I had a similar situation on an overground line in London not so long ago. I didn't know the area and the first machine the missus and I came to was broken and as the train was arriving we jumped straight on (there's no barriers either end) and within a minute we were being asked for a ticket...