Ulcers in fish are normally bacterial infections but you need to know which bacterium is causing the problem. In addition to that, dwarf gouramis are often infected with an Iridovirus and Tuberculosis (TB) and both diseases can cause ulcers.
Melafix, Pimafix and fungus medications won't do anything to treat bacterial infections.
If you are going to use Methylene Blue just put the fish in a container of tank water with an airstone bubbling away, and add methylene Blue and leave the fish in the medication until the sore is gone. Methylene Blue might help because it kills many different types of bacteria but it might not work on the specific bacterium that caused the ulcer.
----------------------
If the fish has the Iridovirus then its immune system will need boosting. Feeding lots of variety of foods and feed 3 or 4 times per day. You can add a vitamin supplement to the food, and you can blend up some spinach and mix that in with the food for a bit more Vitamin C. But a vitamin supplement should have plenty of vitamin C in.
Try to use a dry powder vitamin supplement and check the expiry date before you buy it.
Increase water changes to 75% each day to compensate for the added food and to help dilute any viruses and bacteria in the water.
----------------------
If the fish have TB there is no cure and the best you can do is boost their immune system while you wait for them to die.
----------------------
You could take the fish to a vet and let them take a swab of the sore and look at it under the microscope. They should be able to tell you what is in the sore and prescribe anti-biotics, which should work assuming the bacteria are not drug resistant. However, this will cost a bit of money and might not be worth it financially.
If you have access to Erythromycin you could try it but it might not work, and it will wipe out filter bacteria. So it is best used in a separate glass or plastic tank without a filter. Fill a spare tank or plastic storage container with tank water, add a heater and an airstone and put fish in. Add anti-biotics and see what happens.
You will need to flush the container/ tank out each day and replace all the water and retreat the fish. You should also wipe the inside of the container down each day. You will need to keep the fish in the medicated water for at least 3 days after the wound has healed.
The used water with anti-biotics in can be poured on the garden or lawn and should not be poured down the drain.
----------------------
If your tank has the Iridovirus or TB in, it is there until you strip the tank and sterilise everything.
Your best bet is to avoid keeping dwarf gouramis (Trichogaster lalius) in any of their colour forms.