The only realistic way to get from Albufeira to Sagres by public transport is by bus.
It is necessary to take a bus from Albufeira to Lagos.
Current Timetable here: http://bit.ly/bB9nPB
Then another from Lagos to Sagres.
Current Timetable here: http://bit.ly/6CpGiy
Note that not all the buses run daily.
Click on the word "ver" to see detail. "Diariamente" means "daily".
Timetables from Sagres to Lagos:
Current Timetable here: http://bit.ly/9U2GN5
Timetables from Lagos to Albufeira:
Current Timetable here: http://bit.ly/daITKD
There is a train leaving Lagos at 19h14 arriving Albufeira Station at 20h22.
Please note, however, that Albuferia station is 8km from Albufeira Centre.
There is no bus to Albufeira that connects with this train so it would mean a taxi to town.
Also see Cubsur's excellent website here: http://www.algarvebus.info