A lawsuit seeking to block the merger of Mayo Regional Hospital with Northern Light Health is heading to court late next month after the Maine attorney general’s office and both health care organizations all filed motions seeking to dismiss the case.