The most direct route from Vilamoura to Fatima by public transport is by bus from Quarteira, the town right next to Vilamoura.
Bus operator Rede Expressos offer several services daily via Lisbon Sete Rios Bus Station.
The following is an extract from there current schedule:(Double Click on the + sign below to enlarge )
By train, you would have to get a service from Loulé Station, 6km from Vilamoura to Lisbon Gare Oriente.
See the second part of this post on my blog for more details:
http://barlaventostravelblog.blogspot.com/2007/08/algarve-albufeira-fatima.html