Here is a concrete counterexample.
Let $X$ be a degree $4$ plane curve with a unique node $r \in X$. The normalization $f \colon \tilde{X} \to X$ is a genus $2$ curve, hence hyperelliptic. Let $p, q \in \tilde{X}$ be two points that are conjugate under the hyperelliptic involution and do not map to $r$ under the normalization map. Considering $p$ and $q$ as points of $X$, I claim that the line bundle $\mathcal{L} := \mathcal{O}_{X}(p+q)$ has the desired properties.
Indeed Indeed, I claim that we have $h^{0}(X, \mathcal{L})=1$, but $h^{0}(\tilde{X}, g^{*}(\mathcal{L}))=2$$h^{0}(\tilde{X}, f^{*}(\mathcal{L}))=2$. For
For the second equality, just observe that the line bundle $g^{*}(\mathcal{L})$$f^{*}(\mathcal{L})$ is just the line bundle associated to thea Cartier divisor $p, q$, now considered as pointsgiven by a conjugate pair of $\tilde{X}$. These points are conjugate. In other words, so $g^{*}(\mathcal{L})$this line bundle is the pullback of $\mathcal{O}(1)$ on $\mathbb{P}^1$ under the degree $2$ map $\tilde{X} \to \mathbb{P}^1$.
On the other hand This has a $2$-dimensional space of global sections, coming from the global sections over $h^{0}(X, \mathcal{L})=1$$\mathbb{P}^1$. This
The first equality can be seen using Riemann-Roch. If $\omega$ is Examining the dualizing sheafRiemann-Roch formula, then itwe see this equality is equivalent to show that the equality $h^{0}(X, \omega(-p-q))=1$, where $\omega$ is the dualizing sheaf. But by adjunction, $\omega$ is just the restriction of $\mathcal{O}_{\mathbb{P}^2}(1)$$\mathcal{O}(1)$ on $\mathbb{P}^2$ (adjunction!), and certainly thereso the vector space in question is just homogeneous polynomials in $X, Y, Z$ of degree $1$ that vanish at two distinct points. Linear algebra shows that this is a $1$-dimensional space of.