A machete is not a sword because it isn't
harmonically/dynamically balanced like one, is made for a different
purpose, is thinner, lacks a guard and pommel, and is usually a
different profile.
Either can be "better" than the other, depending on what it is
used for.
If you are harvesting the agave cactus to make mescal or cutting
your way through a jungle, the machete is better.
If you are in hand-to-hand combat, a Japanese sword (katana) is
probably better, as long as you are trained to use it correctly and
effectively.