We arrived at the train station and a bunch of the routes weren’t happening because it was a holiday, but I ordered an Uber and it cost about $20 plus tip to drive right to the front entrance of the Moorish Castle (or the palace if you wanted). Drive took 30-40 minutes. Very scenic near the end.
Uber is ridiculously good and cheap everywhere in Portugal.