I have a heater that my metal fount can sit on - it takes almost no $ to run, it has an internal thermostat so it kicks on at about 34*, and just keeps the water warm enough to not freeze.
It was 75$ at my farm store....38$ on
Amazon
I prefer to shop locally....but I ordered that time!
Anyway- for your set up. Do you have sufficient access from the top that you could put a trough heater inside?
If your barrel is plastic, the do make trough heaters that are “caged”/ safe to use in plastic troughs.
If you only have a small opening at the top....
Unfortunately, I’m not sure how you could protect it apart from heating up the area where it is.
And I’d be afraid those cups might crack if they freeze....
I suggest at least/ also make sure you have several spare cups on hand just in case.
Or, you could make it your “fair weather waterer” and drain it before the cold really sets in- and use a different type of waterer.
How many ducks do you have?