Well depends what you want.
If you upgrade a mace, it’ll only give you physical attack.
If you upgrade a rod, it’ll only give you magical attack.
If we are ONLY considering basic attacks and not other skills, then magical attack is still slightly better to have (compared to phys attack) because it will increase Aspersion damage which is holy element additional attack, while the mace will only give damage to your physical bludgeon type attack (first hit). Holy element attack is much better than Bludgeon, therefore getting magical attack is better (because of monster’s weakness).
But instead of using your silvers with weapon upgrades, you can invest on a +elemental damage headgear, for example. If you get a +30 holy element headgear, you’ll deal 30 more damage per hit (so 30 * 5 = 150 extra damage with cafrisun set). That’s much cheaper than the price of all the upgrades you’d have to refine your weapon with to obtain that same amount of damage (because the magical attack from weapon would only apply to 1 hit, so you’d need +150 damage from weapon upgrades to even it out). Again, that is only for basic attacks.
Note that the TYPE of element damage the headgear provides (poison, holy, fire, etc) will not matter at all because the additional attacks will be forced on their additional attack element (cafrisun will always be earth element hit, sacra hit will always be holy, last rites hit will always be holy, aspersion will always be holy).
But if we consider a skill like Carnivory, upgrading your weapon with magical attack might be cheaper than buying a super expensive elemental headgear (because the magical attack will apply per hit of the skill, similarly to the +elemental damage). So getting +30 holy damage from headgear or +30 magical damage from an upgraded rod would be basically the same for Carnivory.
So in short, if your build is mostly oriented towards basic attacks, investing money on +element damage headgears is better than upgrading your weapon. If your build is mostly oriented towards skill spamming, invested money on +weapon upgrades might be better than elemental headgears (but it also depends on what skills we are talking about).
Of course, if you already have expensive elemental headgears, prices for even better headgears will go up exponentially. Which probably makes it cheaper just upgrading your weapon instead.
EDIT:
Another comparison example:
Valia will give you +144 (aprox) damage on bludgeon hit, +117 damage on aspergillium hit, +50 damage on each hit. Totals 144 + 117 + 250 = 511 bonus damage. (not considering devil type mobs)
Arde dagger will give you +153 damage per hit. Totals 153 * 5 = 765 bonus damage.
Five Hammer will give you +55 damage on bludgeon hit, +45 damage on aspergillium hit. Totals 100 bonus damage. BUT it will also give you the ability to hit 3 or more mobs at once, effectively doubling your total damage on certain situations. If your total basic attack damage is say, 2k, which is very reasonable for 5 hits and at least a little bit of gears, Five Hammer adds you +2k bonus damage.