Its not really a one or the other thing.
Epoxy doesnt have uv protection and must be followed up with something that does, like
paint or varnish or
polyurethane.
It controversial, like everything, but some folks have great results (longevity) using epoxy to immobilize the substrate and something on top as uv protection, like a 2 part poly or 1 part poly, or a varnish.
Best to completely encapsulate the wood with the epoxy, if
water can get in anywhere it'll end up causing the epoxy to start to separate from the wood and will be somewhat harder than trafitional varnish to repair.