A multi-million pound project aiming to transform the areas surrounding two North Yorkshire railway stations is set to begin.