I got to the station after the train had already left.

Literal

Train [subject-が] left [completely-てしまった] after [in-で], I [topic-は] station [at-に] arrived.

The completive ~てしまう here frames the train's departure with a regretful/final tone — 'already gone by the time I got there.' 後で ('after') uses で to temporally locate the main clause. The internal clause takes が for its subject, standard in subordinate clauses.