Do you mean that the train began to move of its own volition?
If so, then itself is a pronoun and is part of the adverbial phrase by itself in which by has been elided.
It would be better to place itself at the end of the sentence.
The train began to move (by) itself.
Do you intend itself to be emphatic?
It is still a pronoun
I don't think you should use commas to isolate itself.