The sentence conveys two sequential events: 1) Her arrival at the station, and 2) The train's departure. This implies immediate succession.
"Scarcely" pairs with "when," not "than." "Than" is typically used for comparisons and is therefore incorrect in this construction.
The sentence must adhere to the inversion structure: "Scarcely had [subject] [past participle]... when [simple past]."
While "when" is correct, the verb tense "was leaving" does not reflect the immediate action signified by "scarcely." The simple past tense is required.
The conjunction "than" is inappropriate for this structure.
The word order is erroneous; correct inversion dictates "Scarcely had she reached" for grammatical accuracy.
This option conforms to the correct structure: "Scarcely had [she] [reached]... when [the train left]."