There is no universal answer, because the "best" weapon is usually the one its owner has actually mastered. A skilled fencer with a sword will beat a nervous beginner holding a pistol, and a crack shot with a revolver will beat someone swinging a blade they have never trained with.
Melee and ranged weapons each have real advantages. Reach, armour and timing favour the sword; distance and speed favour the firearm. Put a person in body armour with a katana against someone in street clothes with a small pistol and the outcome comes down to spacing, nerve and practice, not the equipment list.
In games and fiction, personal favourites tend to be the katana and the AK-47, but that is taste rather than fact. Heavier hardware such as rocket launchers and bazookas is more destructive still, and the nuclear bomb sits in a category of its own.