They pull the old Scylla maneuver
A hydra would be a terrible flying animal. They would by definition be front-heavy because of all their extra necks and heads (not to mention the large heart and lungs required to sustain said necks and heads), which would result in the animal being tipped forward while in flight and prone to be sent into a tailspin. Their body plans makes them not aerodynamic at all because the thickest area of the body is at their front, rather than the animal being in a torpedo or bird-like shape. On top of that all of the additional heads would be a liability when catching prey. The heads and necks moving every which way chasing prey would send the animal frequently off balance while in flight. At minimum it would require an extremely high degree of coordination, which would require huge brains with large flocculi per head, which becomes multiplicatively expensive for a hydra and kind of defeats the purpose of a hydra in the first place.
What flight would allow a hydra to do, on the other hand, is get the hydra into position where it can attack unsuspecting prey. Sort of like what Scylla did in The Odyssey. Fly up to a high rocky crag where you know flying prey like birds or bats or small dragons are passing by and use your head to snag some of them as they fly past. This is analogous to how long-necked predators in Earth's past, such as Tanystropheus and plesiosaurs, are thought to have caught prey. Being able to fly increases the number of positions an animal can take to ambush prey, especially ambushing from above. A hydra may be a terrible flyer from a comparative perspective, but it still should be able to at least get itself into the air and haul itself over to a good hunting perch.
A hydra would also have to have a high degree of correlation between its heads, and the heads would almost have to be linked somehow and not be fully separate organisms. The reasons for this can be seen in developmentally abnormal snakes that have two heads: when presented with food the two heads will fight with each other over who gets to eat despite the fact that the two have the same stomach, wasting time and energy. A fully coordinated hydra would be well-suited to using its heads to out-maneuver and corner small flying prey like bats and birds.
As a corollary, getting up high and then snagging birds and bats as they fly past in large numbers is exactly how snakes and centipedes hunt flying animals in real life, though none of them have multiple heads.