When I went a few years ago, the trains that ran over the Tagus had a different system to the trains elsewhere and I had the pleasure of being marched to a ticket office to buy a correct ticket. I hope it is simpler now, but if not I am sure someone will be able to explain it better than me.