Another way of doing this by rail with a bit of a detour is to go via Vigo and Porto - you'd take trains from Barcelona to Vigo (via Madrid), the Celta from Vigo to Porto, and then a train onwards to Lisbon from there. There are two stations in Vigo and it's likely you'd arrive at one and depart from the other.
Looking at times for 17th November (a random weekday around a month in the future), there are two direct trains from Vigo to Porto, one early morning and one in the evening, meaning you'd need to break your journey somewhere along the way.
An alternative to this could be to take the 0740 from Barcelona to arrive in Vigo (Urzáiz) at 1538, make your own way to Valença, and then you have a choice of trains to Lisbon with the last one being at 2024 - giving you around six hours to get from Vigo to Valença (Portugal is one hour behind Spain). Vigo to Valença is 33km via the AP-9 motorway.
FrustratinglyTo get from Vigo to Tui, there'syou can check bus times on bus.gal. There appears to be a bus which leavesleaving Vigo E.I. (Estación Intermodal, next to Vigo Urzáiz station) at 19451630, arriving at Ponte InternacionalTui (in TuiPraza de Galicia) at 21061726, but then you'd needgiving you ample time to make your own waycross the bridge (Google Maps says Tui Praza de Galicia to Valença station on foot and it's likely you'd just miss the last departure to Lisbon by around five minutesis a 46 minute walk). The nearest rail station would be Guillarei, butThis should allow you to connect into the last train from Vigo leaves at 1410. Likewise1810 (again, the last train to Lisbon leaves Porto around halfremember Portugal is an hour before the trainbehind Spain, so this isn't quite as tight as it sounds) departure from Vigo arrivesValença to Lisbon, changing at Nine and arriving at Lisboa Oriente at 2322.
Unfortunately the sleeper train from Barcelona to Vigo no longer runs.