Not sure how much an 18-month old kid will get out of either the Railway Museum or the Jorvik Centre to be honest.
York to Whitby is about 90 minutes.
York is an excellent weekend, I would recommend both of the above, but if you go to the Jorvik, make sure you pre book tickets to avoid the dreadful queues. Also the boat trips on the river are good too. If you like the railway museum/trains etc the North Yorks Moors steam railway is very good, starting at Pickering. If you don't want to go as far as Whitby to see the sea Scarborough isn't too bad.