In 1844 The Leeds and Selby Railway Company was acquird by the York & North Midland Railway (YNMR) [i] In that year the Y&NMR received permission to build a line from York to Scarborough [ii]
References:
[i] https://en.wikipedia.org/wiki/Leeds_and_Selby_Railway
[ii] https://en.wikipedia.org/wiki/York_and_North_Midland_Railway