The story, I first saw, said the bears chased the macaque into the electric fence. That would make sense because he'd need a good start to stretch that wire all the way to the water. Also, in the first picture, it looks like the bears have a healthy respect for that fence.
You Brits better hope the Sloth Bears don't make it to Gibraltar.