The ruling by the judge, Alvin K. Hellerstein of Federal District Court in Manhattan, was a stinging defeat for the plaintiffs — among them a former professional football player who owns a company that sells pot-based pain relievers, a 12-year-old girl who treats her chronic epilepsy with medical marijuana …