The Federation wasn't choosing
between genocide and survival. They chose
both. Genocide for the Founders, and survival for themselves. Should they have handed the cure over to the Founders and hoped for some goodwill in reciprocation? In the end, the cure was exchanged for an end to hostilities, a much better deal for both sides than if the Feds had given the cure away without expecting anything in return. The Feds have high ideals, but they're not naive.