Longswords are medium-speed slashing weapons used in melee combat. While they have a slower attack speed than scimitars, longswords are able to hit higher in a single attack. Many players prefer them to two-handed swords both because a shield can be equipped with a longsword, and because longswords have a faster attack speed. Scimitars, however, have been proven to deal more damage over the course of fights due to having higher attack speeds than longswords. Like all slashing weapons, longswords are good against cloth and leather armour.
The katana is two-handed, unlike other longswords which are one-handed.
In short, scimitars deal more DPS (damage per second) against most monsters than longswords, and are better suited for PvM and training melee stats. Longswords have slightly higher strength bonuses, which gives them higher possible maximum hits. While the dragon longsword in particular could potentially deal a higher damage combination than its scimitar counterpart (both in terms of a maximum single hit, and when used alongside a specific combination of weapons in which the dragon longsword special attack is utilised), in most cases the scimitar is substantially more effective in PvP combat. Conversely, the dragon scimitar has a unique special attack (the temporary removal/blockage of opponent's use of damage protection prayers) that can be notably more effective than the dragon longsword special attack when used in a multitude of PVP scenarios. For all longswords below dragon, and when comparing regular (non-special attack) hits between longswords and scimitars, the scimitar deals superior DPS than the longsword. The scimitar is superior in virtually every PVM and non-special attack PVP situation, even when accounting for the impact of particular attack style weaknesses inherent with specific armour and NPC bonuses. Overall, it is recommended to get a scimitar over a longsword whenever possible.
The scimitar and longsword are very similar weapons as they are both slash weapons and have nearly the same attack bonus for slash. However, scimitars have an attack speed of 4 while longswords have an attack speed of 5. This lets scimitars attack 1 tick (about 0.6 seconds) faster. Longswords have slightly higher strength bonuses than their scimitar counterpart, which gives them an additional +1 to the maximum hit.
Comparing the two weapons, the scimitar will hit 20% faster in exchange for 1 damage to the max hit. This makes them better to use than the longsword in most situations.
It gets more complicated as other factors come into play, such as enemy's defence bonuses, the player's Attack and Strength levels, and the player's attack bonuses from other gear. As a simple example, dragons are relatively weak to stab. Longswords have a much higher attack bonus for stab than scimitar and will do more DPS, assuming the player is using the stab attack style on the scimitar. Scimitars will still do more DPS to dragons than longswords if the slash style is used for the scimitar, even if the longsword is used on stab.