Lionelville: Destination Adventure! (2009).
From IMDb:
It is about a couple of scientists who develop a surreal experience for people to feel that they are actually on an old time steam engine. A grandfather takes two grandkids, a girl and boy, on the ride. Their father and mother are part of the development team. Bad guys steal the engine with secret circuits and it sets off a reaction that sucks the parents and two of the bad guys into an alter universe of some kind made up of trains and towns, somewhat what it would be like to live in the towns on your platform. The grandfather takes care of the kids and eight years later they meet up with the head scientist and together they set out to get to Lionelville and find the parents while being chased by bad guys. They get away to Lionelville on a special engine and train made by the scientist. When they get there, they begin to look for the parents and the two bad guys are looking for them as well.
Found with the Google query animated movie parents train other universe scientist site:imdb.com/title
.