Hi, I did this a few years back and found it very easy. Train station about 20 minute taxi journey from Albufeira and approx 2-3 hour train journey to Lisbon - well worth it, loved Lisbon.
I've been a few times, last two times I was on a package deal so transfers organised. One time got flight only and arrived in middle of night so got a taxi from Faro into Albufeira - that was a long time ago and a holiday on a very tight budget so the taxi fare couldnt have been that expensive!
You could stay in faro or albuferia for one night....numerous pensions or ask at the bus station..might be tricky in july and august.Can take bus or train to lisbon. Well worth it if you have the time.I presume you have a package holiday in albuferia...With a 2 week holiday..you could go to lisbon for one week..you need at least 3 or 4 days in lisbon.With a one week package holiday you could still go to lisbon..but won`t leave much time for the algarve.
You have plenty of time
Get an open return ticket for bus or train so you can decide how long you stay in lisbon..I think you need 2 or 3 days there.Dònt hire a car.. . not suitable for a journey like that.