A state appellate court ruled in favor of Success Academy in a high-profile, 2-year-long conflict with New York City officials over whether the biggest charter network in the city can run a pre-kindergarten program free from conditions set out in a city contract.