Unless you go up to Lisbon the day before, the only way to do this is by bus:
Rede expressos have a departure from Albufeira Main Bus Station at 02:20hrs. arriving Lisbon Sete Rios Bus Station at 05:30.(Current Price - 18 Euros) You would then need to take a taxi to the Airport.
Renex have a departure from Albufeira Main Bus Station at 01:55hrs. arriving Lisbon Gare Oriente Bus Station at 05:00. You would then need to take a taxi to the Airport.
You can find a link to timetables on my blog here:
http://barlaventostravelblog.blogspot.com/
Scroll down on the right hand side panel till you come to:
»» Algarve & Portugal - Travel Transport Links
»» Continue scrolling down in this section till you come to the timetable you want.
Please note that the trains do not offer a suitably timed service.