ALBANY — A judge dismissed a lawsuit on Wednesday that sought to stop a casino gambling referendum next month in New York State, saying the legal challenge over the measure’s wording was “untimely and lacking in legal merit.”