My experience with goats and electric fence has been that they will charge right through if they want to badly enough. It shocks them, they scream and stumble, but keep right on going. If the rails on the horse fence are low enough and close enough together that the goats would have to slow down, scramble and squeeeeeeze through, they might not want to risk getting shocked by a collar for that long. But if they learn that the shock stops on the other side, and they can dash through, they very likely will.
What has worked for me is welded wire to keep them in, and an electric wire at shoulder height to keep them off the welded wire (they love to rub on the welded wire). Where I have board fencing, running an electric strand along the gap between the boards keeps them from trying to push through. A hot wire like that will also discourage predators that might crawl through a rail fence otherwise, though you will need to keep grass, etc, from growing up, since electric fencing will ground out through the plants and be rendered ineffective.
What has worked for me is welded wire to keep them in, and an electric wire at shoulder height to keep them off the welded wire (they love to rub on the welded wire). Where I have board fencing, running an electric strand along the gap between the boards keeps them from trying to push through. A hot wire like that will also discourage predators that might crawl through a rail fence otherwise, though you will need to keep grass, etc, from growing up, since electric fencing will ground out through the plants and be rendered ineffective.