Hammers are essentially the best against goblins, the most common sort of threat you'll face. Against other enemies, they might not be so hot, as you've found out. in general...
Hammers: Crushing, deal with armored dwarf-sized enemies very well, or big fleshy ones (like ettins or minotaurs) who can be knocked down or surprised and then have their skull bashed in for a quick kill.
Maces: Like hammers, but not as good*
Axes: Sever limbs like no one's business. Go-to armaments against hard semi-megas and megabeasts, but they'll bisect goblins in a pinch just fine.
Swords: Like Axes, but not as specialized*
Spears: Piercing weapons that will destroy organs and cause massive bleeding. Excellent for dealing with anything fleshy and too big for a hammer, but also acceptable on normal targets
Crossbows: Your only real ranged option: excellent to support any strategy, but kind of pathetic at killing on their own. They're also the only weapon that can be made at 100% functionality without access to weapon-quality metal: bone crossbows firing bone bolts do just fine. In melee, they work like weaker hammers, usually much weaker due to being made out of kittens or logs to save metal. Keep your archers out of melee.
Whips: The only foreign weapon worth noting, these are basically lightsabers against standing humanoid troops, laughing off armor due to being blunt and causing massive damage due to high weight and low contact area. Suffer the same vulnerabilities as hammers, only moreso. In fact, they're basically more exaggerated hammers in general
*And yet, there are situations where I would prefer to have these weapons than their more general-purpose counterparts: there is no good reason not to train up at least a few sword and mace lords to back up an array of axe, hammer, and spear.
As others have mentioned, you ALSO get unlucky on your titan spawns, having two made out of hard materials and if you're REALLY unlucky in a nasty shape, but Dwarf Fortress is not a game where you can overspecialize to victory (at least in terms of your army.) There are games you can win with spam of "the best unit". This is not one of them.