he was prolly on the train because Dumbledore wanted him to keep a close watch on Harry.
he knew dementors would be around and he wanted him to be safe.
it might be because he was tired and ill from the transformation, but i def think Dumbledore sent him there.
the dementors were under voldemorts control then and since there was nobody except students on the train, harry needed protection.
there was nobody on the train in OoTP prolly because by then Harry knew how to protect himself against dementors, duh
