The following characterisation is well known. It can be found in Engelking's book as Theorem 3.11.10.
Theorem: A Tychonoff space $X$ is realcompact if and only if for each $p\in\beta X\setminus X$ there is a continuous function $\varphi:\beta X\rightarrow [0,\infty)$ such that $\varphi|_X>0$ and $\varphi(p)=0$. $\;\blacksquare$
Thus suppose the weaker condition, that for $p\in\beta X\setminus X$ there is an upper semicontinuous function $f:\beta X\rightarrow[0,\infty)$ with $f|_X>0$ and $f(p)=0$.
Theorem (Katětov-Tong): A space $Y$ is normal (not necessarily $T_1$) if and only if for any upper semicontinuous function $f:Y\rightarrow \mathbb{R}$ and any lower semicontinuous function $g:Y\rightarrow \mathbb{R}$ satisfying $f(y)\leq g(y)$ for each $y\in Y$ there is a continuous function $\varphi:Y\rightarrow\mathbb{R}$ with $f(y)\leq\varphi(y)\leq g(y)$ for all $y\in Y$. $\;\blacksquare$
Of course $Y=\beta X$ is normal. Since $\beta X$ is compact, every upper semicontinuous function defined on it has an upper bound which it attains. We can assume the upper semicontinuous function $f:\beta X\rightarrow[0,\infty)$ is bounded above by $1$. Take $g:\beta X\rightarrow\mathbb{R}$ to be the characteristic function of $\beta X\setminus\{p\}$, so that $g(p)=0$ and $g(q)=1$ if $p\neq q$. Since $\beta X\setminus\{p\}$ is open, $g$ is lower semicontinuous.
We have $f\leq g$ everywhere, so from the Katětov-Tong Theorem we obtain a continuous function $\varphi:\beta X\rightarrow [0,\infty)$ with $\varphi|_X>0$ and $\varphi(p)=0$. Thus we see the sufficiency of this condition for the realcompactness of $X$.