@RCSnipes100 is right, there are major differences in mobility between the sloop and galleon.
The galleon is designed for big broadsides and long straight runs (sailing straight without turning) In a race without turns, the galleon will win every time (if both ships have the same wind direction). Also, as I said, it is designed for big broadsides, it will try and go straight to get max speed, then turn to get a broadside on you. So if you see a galleon straighten out and set sails, duck in behind it or turn in the opposite direction to escape.
Sloops on the other hand are designed for hit and run tactics. In a turning contest, a sloop will sail literal circles around a galleon with ease. So while it can't win a straight race with a galleon, it can out maneuver it. Use this to your advantage by ducking behind the galleon and angle yourself occasionally to take pot shots. Another good tactic is to stick close to land while fighting a galleon. Galleons are meant to fight on the open sea where there are no obstructions. But a sloop is best in an area where there are obstacles. Since a sloop can turn fast and pick up speed easily (since it only has the one sail to adjust) you can sail around the island or rocks using them as shields and put a major hit on the galleon's speed since they will have to turn to not only avoid the land, but also to get a broadside.
Also, don't forget to take in some sail when turning, it cuts your speed but also cuts your turn radius down, so you turn faster. This works on both ships.
Hope this helps.