This problem is an indication of resistance near or on the battery contact. When there is resistance present, any current through the connection will be converted to heat.
As you described, when you put a load on the UPS, it starts to melt. The load is the increased current that flows through the connection.
Try cleaning the connections, making sure any hardware such as clamps and screws are very tight, and making sure that any wires are firmly attached to the hardware and not coming loose.
Based on the picture you added to your question, I would make sure the battery post ifis very clean, that the crimping of the ring connector is very tight - it does not look so in the picture (perhaps solder it as well), and you may wish to consider adding a flat washer with a star washer underneath it, immediately on top of the ring connector. This will help with the electrical connection.
Also make certain that your UPS is not drawing more current from the battery than its rating.