I would like to inquire about Twinmotion animation.

How can I create an animation where a train moves along a curve rather than a straight line?

You can use the custom path tool.
Add the train to your user library, and dop it in the box of the path tool properties