Buses are to replace trains between Leeds and York for three weekends.