Why do you want to code this?
Isn't it much easier to create a node/scene for every possible tile and place the path manually?
(Sorry, i have no clue about your project-structe, node-tree, etc. and i never had a similar problem before :P)
Another possible way would be a math-function, that know where to place your train, depending on its progress through the tile. That might be more accurate, but you have to write a function for every possible way in each tile...
@all: any suggestions? please?