Killing Polyphemus would've been very hard indeed. The huge, one-eyed giant would present a difficult target for anyone, even brave, skilled warriors like Odysseus and his crew. There was also no guarantee that stabbing the Cyclops in the liver would've killed him; it might have just made him incredibly angry, with devastating consequences for Odysseus and his men.
Besides, the men didn't have their weapons with them; all they had was a sharpened stake. That might well have severely injured Polyphemus, but it wouldn't necessarily have been enough to kill him. In any case, even if was, the men trapped inside the cave would still have needed to find a way to remove the huge boulder blocking the entrance. Only Polyphemus had the physical strength to do that. So, Odysseus comes up with a much better idea than simply killing the Cyclops.