First, you won't find a train between Lisbon and Tarifa. It's tricky getting from Portugal to Spain - as strange as that seems. And, renting a car in Portugal and dropping it off in Spain won't work either. There is a night train from Lisbon to Madrid but it's long and reviews range from good to terrible. Your best bet is likely to go to the Algarve, then take a bus from Portugal to Tarifa. Rome2rio is a great websit that will give you options.
You also don't need or want a car in Lisbon. You can easily day trip on the train from Lisbon to Sintra and parking in Sintra is very challenging. However, if you want to visit Evora, a car is useful.
I would suggest you purchase a RS Portugal (if you haven't already) as he gives info on places in central Portugal you might want to visit.
You could spend 4 or 5 nights in Lisbon, then pick up a car and drive north to Óbidos and Coimbra for a couple of nights. Then drive to Evora for 2-3 nights. The train from Lisbon to the Algarve works great and is inexpensive (especially if you buy tickets ahead). You could drop off the car then train to the Algarve (Faro is direct train ride), Then take the bus to Spain.
There are many different options of places to visit and the train works well for a lot of them. It really depends on your interests.