I’m considering a trip to Madrid. Is there a city in Portugal two hours or less by train that would be interesting to visit for a day trip? Lisbon and Porto are too far.
No. The only train that crosses the Spain/Portugal border in that region is the once daily Madrid-Coimbra-Lisbon overnight train. Buses to a border-area town such as Pocinho take about 4 hours one way (bus by Rede Expressos).
It’s a relatively short flight between Madrid and Portugal, but getting to the airport, checking in, going thru security, etc. will add a lot to the time just spent in the air.