You are not taking attack speed into account. Katar has 50% higher attack speed than a sword. When you factory in the katar mastery, you will find that katar and sword are equal. If you then factor in crit chance, the katar becomes better due to its attack speed,
Katar: Lower base damage + Katar Mastery, high attack speed preferred for crit-focused dhan (agi)
Dagger: Lower base damage, same high attack speed as katar but without mastery not as good. Old days you could get a sword mastery buff from guards to offset this. Not anymore.
Sword: Higher base damage, lower attack speed. No mastery and will have a lower net crit rate. Preferred for reg attack dhan (str) but still less than katars if you factor in crit rate ability.