Time depending shortest-path problems with applications to railway networks