Buses will replace two midday trains between Riverhead and Greenport this Wednesday and again next Wednesday to allow for maintenance work, the Long Island Rail Road said.

The eastbound 10:44 a.m. from Ronkonkoma will terminate at Riverhead, where riders can board buses for Mattituck, Southold and Greenport. Riders are advised to add up to an additional 10 minutes of travel time.

Westbound riders who will be affected are those taking the train that usually departs Greenport at 12:42 p.m., Southold at 12:52 p.m. and Mattituck at 1:05 p.m. Those riders will instead find a bus in the station parking lot.

To allow buses enough travel time to connect with the train at Riverhead on its usual schedule, buses are scheduled to depart up to 12 minutes earlier than the train’s scheduled departure time, the railroad said.

advertisement | advertise on newsday

The bus is scheduled to depart Greenport at 12:30 p.m., Southold at 12:41 p.m. and Mattituck at 12:55 p.m.

The bus is scheduled to arrive at Riverhead at 1:12 p.m., allowing customers to connect to the regularly scheduled westbound train departing at 1:21 p.m.