There's a lot of detail that can go into these sorts of discussions, mostly since game physics have minds of their own whenever you get down to the little things. There are a couple of reasons for it from multiple perspectives, so I'll go over them somewhat briefly.
Swords are iconic. They're as much symbolic as effective. They're designed to cut into opponents, but they're also long and relatively heavy. It means they can impart a greater leverage and weight to the point of impact (when compared to a bullet), but still are quick and agile for close quarters. It means that someone with a large, naked blade is likely more intimidating than one with a Colt .45. It's part the visual, and part the psychological. A sword is also more personal, with the attacker having to be within a few feet to deal damage. It means they're very much a part of it, the death becomes more personal. If they look like they've been in a few scuffles already, it just makes it that much more scary.
Guns are ineffective at a certain proximity. An arm, extended for accurate shooting with a handgun, barrel length included, is about 3 feet on an average person. At that range, the targeting options are pretty limited. With a moving target, assuming there's even a direct hit, wouldn't have as much stopping power of defensive capability as a sword, or baton, or any melee weapon really. Since jRPG fights seem to imply the fight's at close-quarters already, a gun is likely to impart less physical damage than even bare fists, much less a bladed weapon like a knife or a sword. There's a reason most military organizations outfit their soldiers with knives as well as guns.
Less micromanagement. To maintain a sword, it means occasionally sharpening a blade, and oiling the blade/scabbard for easy drawing and reduced friction-damage for repeated withdraw-replace motions. A gun, however, needs to be disassembled, its parts oiled, everything to be loaded and prepared before battle. Clips cannot really be assembled on the fly, jams take time to clear, and ammo is limited. A sword can work until it is broken. A gun will work until it runs out of ammo, is jammed, it malfunctions critically, or its broken. It's a lot of variables to keep up with, not to mention counting rounds to know how many shots are left in a clip, how many clips are left over, and so on.
Tradition. RPGs, by a pretty good majority, had their start in fantasy. It meant swords, horses, and the inability to swing a cat without a mage somewhere. Even in the modern setting games, like FF VII and VIII, you can still see the roots. Certain characters are visibly mage-oriented, while others are all attack, and some jack-of-all-trades, all nodding back to the warrior, white mage, and red mage of the original title. If for nothing else, the sword is iconic of the strong, heroic warrior in front of the party.
Either that, or people like swords. If you had an opinion poll to pick between samurai, ninja, or a army man, I'm willing to bet you know which one will be the odd one out.