That categorical definition is for pre-sheaves, the topological definition is for sheaves.
In topological pre-sheaves, a map is surjective if it is epimorphic for each open set $U$ in $X$.
In topological sheaves, however, we instead have to "sheaf-ify" the definition, and we say that the map is "surjective" if the sheaf-ification of the cokernel map is zero.
Basically, in both cases, you have two categories, $\mathcal{Sh}$ and $\mathcal{PSh}$, and in $\mathcal{PSh}$, the "surjective" maps are the ones that are epimorphisms on each $U$, but in the $\mathcal{Sh}$ catageory, you have a more complicated definition of "surjective" (or "epimorphism.")
Consider, instead, two categories, $\mathcal{Ab}$ the category of abelian groups, and $\mathcal{AbTF}$, the full subcategory of "torsion-free" abelian groups - that is, the abelian groups, $A$, where for any $n\in\mathbb Z$ and $a\in A$, $na=0$ iff $n=0$ or $a=0$.
There is the natural inclusion functor $\mathcal{AbTF}\to\mathcal{Ab}$ and a natural adjoint sending $A\to A/N(A)$ where $N(A)$ is the subgroup of nilpotent elements of $A$.
But in $\mathcal{AbTF}$, the "epimorphisms" are not the ones with cokernel (in $\mathcal{Ab}$) $0$, they are the ones with cokerkels which are nilpotent. So, for example, in $\mathcal{Ab}$, the morphism $\mathbb Z\to\mathbb Z$ sending $x\to 2x$ is not an epimorphism, that same map, when considered as a map in $\mathcal{AbTF}$, is an epimorphism.
So consider the "sheafification" functor $\mathcal{PSh}\to \mathcal{Sh}$ to be much like the functor $\mathcal{Ab}\to\mathcal{AbTF}$.
(I believe, but don't quote me, that $f:A\to B$ in $\mathcal{AbTF}$ is an epimorphism if and only if $f\otimes \mathbb Q:A\otimes \mathbb Q\to B\otimes\mathbb Q$ is an epimorphism in $\mathcal{Ab}$.)
Best Answer
There are two possible definitions for natural isomorphism. For a natural transformation $\eta: F \to G$, both of the following statements make sense.
These two are equivalent. The direction $2 \implies 1$ is easy, for every $X$ we directly see that the inverse of $\eta_X$ is $\theta_X$. For the converse, $1 \implies 2$, there is only one sensible candidate for $\theta$. Namely we take $\theta_X$ to be $\eta_X^{-1}$, the inverse of $\eta_X$. We only need to check that $\theta$ is then indeed a natural transformation. So let $f: X \to Y$ be any arrow. Using naturality of $\eta$ we get $$ F(f) \theta_X = \theta_Y \eta_Y F(f) \theta_X = \theta_Y G(f) \eta_X \theta_X = \theta_Y G(f). $$ It might help to draw the relevant picture if the above is confusing.
So in particular, whenever two sheaves $F$ and $G$ are isomorphic through a natural isomorphism we get that each $F(U)$ and $G(U)$ are isomorphic for every $U$. You mention that an epimorphism of sheaves is not always componentwise surjective. An isomorphism is a very special kind of epimorphism, namely a split epimorphism. A split epimorphism of sheaves is always surjective on every component (nice exercise).