Let the people initially on the train be 'x'.
19 people got off the train --> x - 19
17 people got on the train --> x - 19 + 17
Remaining people on the train = 63
Therefore, x - 19 + 17 = 63
x - 2 = 63
x = 63 + 2
x = 65
Verification:
65 - 19 + 17 = 63
65 - 2 = 63
63 = 63
--------------------------------------------------
Hope I helped!