Use an airport-valid Line 3 ticket. The ordinary €1.20 city fare does not cover the airport section. Around 40 minutes to Syntagma is a planning allowance; add the wait and onward walk. Check the last airport train for a late arrival.
X95 goes to Syntagma, around 60 minutes; X96 goes to Piraeus, around 90 minutes. Both run 24 hours, with traffic and timetable gaps affecting the trip. The €5.50 ticket is for the airport bus. Find the ferry gate before choosing a Piraeus stop.