In this context $\overline{\mathbb{R}}$ is equipped with the Borel
$\sigma$-algebra $\mathcal{B}$.
Let it be that $\mathcal{V}$ is
a collection of subsets of $\overline{\mathbb{R}}$ such that $\sigma\left(\mathcal{V}\right)=\mathcal{B}$,
i.e. $\mathcal{B}$ is the smallest $\sigma$-algebra that
contains $\mathcal{V}$.
If $\left(X,\mathcal{A}\right)$ is a measurabe
space the normal condition for a function $f:X\rightarrow\overline{\mathbb{R}}$
to be measurable, i.e. $f^{-1}\left(\mathcal{B}\right)\subseteq\mathcal{A}$,
can be weakened to $f^{-1}\left(\mathcal{V}\right)\subseteq\mathcal{A}$.
In fact we have $f^{-1}\left(\sigma\left(\mathcal{V}\right)\right)=\sigma\left(f^{-1}\left(\mathcal{V}\right)\right)$
so that on base of $f^{-1}\left(\mathcal{V}\right)\subseteq\mathcal{A}$ we find:
$$f^{-1}\left(\mathcal{B}\right)=f^{-1}\left(\sigma\left(\mathcal{V}\right)\right)=\sigma\left(f^{-1}\left(\mathcal{V}\right)\right)\subseteq\mathcal{A}$$
A proof of that can be found here.
The statement in your question is true because $\mathcal{V}:=\left\{ \left(a,+\infty\right]\mid a\in\mathbb{Q}\right\} $
indeed satisfies the mentioned condition $\sigma\left(\mathcal{V}\right)=\mathcal{B}$.