Trains are the best way to travel between cities in Portugal. For example, the Lisbon to Porto train takes around 3 hours and costs €25-40 depending on the time of day and class. Renting a car is recommended for day trips to smaller towns and villages. Gas costs around €1.50 per liter and tolls can be expensive, so plan accordingly.
If you have extra time, consider spending a night in Sintra or Óbidos. If you have less time, consider skipping Coimbra and spending more time in Porto or Lisbon instead.