Perhaps we should begin by discussing the proof of the proposition in detail. If we emphasize a particularly important step, we will then see why when we consider $\mathbb{Z}[x,y]$, we are lead to the remark that you're asking about.
The proof of the proposition (paraphrasing):
Assume $p(x)$ is reducible in $R[x]$ but irreducible in $(R/I)[x]$.
Then $p(x)=f(x)g(x)$ with $f(x), g(x)$ monic, non-constant polynomials. Then
reducing $f(x)$ and $g(x)$ mod $I$ gives a factorization in
$(R/I)[x]$. Contradiction.
Notice that it was critical that both $f(x)$ and $g(x)$ were monic (or at least that their leading coefficients are units, which can be shown to be equivalent to choosing them to be monic). Why? Because otherwise $f(x)$ could reduce to a unit in $(R/I)[x]$ (this could happen easily, think of $3x+1 \in \mathbb{Z}[x]$ and then consider $\mathbb{Z}_3[x]$). Then we wouldn't have found found that $p(x)$ was reducible in $(R/I)[x]$ and there would be no contradiction!
For completeness: the key point in this proposition is that we are assuming that $p(x)$ is monic and $I$ is a proper ideal. Then the leading coefficients of $f(x)$ and $g(x)$ are units (we argue that we can always multiply by a constant to arrange the leading coefficients to be $1$) and since $I$ is a proper ideal, these coefficients are not in $I$. Then the leading coefficients of $f(x)$ mod $I$ and $g(x)$ mod $I$ are not zero and so we have a nontrivial factorization in $(R/I)[x]$.
So really we need to emphasize why $f(x)$ and $g(x)$ couldn't reduce to a unit. Then it becomes more clear why we need to also worry about factors reducing to units when we consider polynomial rings of several variables.
Some further remarks:
Let's say we try to extend this proposition to $R[x,y]$. But we immediately have a problem: we know we need some kind of "leading coefficient" condition if we hope to repeat the proof as before (or else we need some other condition and strategy to show that reducible $q(x,y)$ cannot become irreducible in a quotient by a proper ideal!). But what we mean by "leading coefficient" is unclear for something like
\begin{align}
q(x,y) = x^3y-6xy^3+x^2y^2+x^2y+3xy^2+x-2y+1
\end{align}
Maybe we mean coefficients of terms of highest degree ($x^3y-6xy^3+x^2y^2$ in this case). Then is it enough to ask that at least one of them have coefficient $1$? All of them? But then notice that
\begin{align}
q(x,y) = (x^2y+3xy^2+1)(x-2y+1)
\end{align}
and so one of the maximum degree terms $x^2y^2$ doesn't arise as simply the product of two lower degree terms - it is the sum of two products. So $x^2y^2$ having coefficient $1$ didn't mean that it couldn't come from terms that are $0$ mod some ideal. The situation can get worse for higher degrees and higher numbers of variables: terms with coefficient 1 could come from a large number of sums of terms. This means we have to think carefully before trying to apply our previous proof.
One such strategy is to recognize that $R[x,y] \cong (R[x])[y]$. In other words the multivariable case can be thought of as the single variable case with coefficients coming from the ring $R[x]$ and so then the condition is simply that the term with the highest power of $x$ (or $y$) should be monic (more generally: check that it's enough to require that the coefficient of the highest power of say $y$ is not an element of the ideal $I[x] \subset R[x]$ that you want to reduce by). If this is the case, then we can simply apply the original proposition of the single variable case. For example
\begin{align}
p(x,y) = y^2 + (7x^2+14x)y+17
\end{align}
has this property and so we have $p(x,y) = y^2 + 3$ mod $7$, which is irreducible and so $p(x,y)$ was irreducible.
Notice that Dummit and Foote's example of $xy+x+y+1$ does not meet this criteria (neither the coefficient of the highest power of $x$ nor $y$ is $1$), so while this wouldn't have proved it was reducible, it would have prevented us from making the mistake they warn against. This criteria also would have been applicable to their other example $x^2 + xy+1$ (and we would have found that it is irreducible).
Since they have not yet introduced the idea of reducing mod some $I[x,y]$, hopefully combining the two parts of my answer fully resolves what we're trying to do, why we can do it, and where we can't, at least with respect to the context of what they're trying to point out at this point in the book.
The element $2$ is a unit in $\mathbb Q[x]$ (it has inverse $\frac 12$) but not in $\mathbb Z[x]$ (since $\frac 12\notin \mathbb Z[x]$). We can write $$f(x) = 2(x^2+2).$$Since a polynomial $f$ is reducible iff it can be written as the product of two non-units, this means that $f$ is reducible in $\mathbb Z[x]$. However, this factorisation does not show that $f$ is reducible in $\mathbb Q[x]$ since $2$ is a unit. One can show in other ways (e.g. because $f$ has no rational roots) that $f$ is irreducible over $\mathbb Q$.
This condition is not arbitrary: it means that the ideal $(2x^2+4)$ is prime in $\mathbb Q[x]$ (and is equal to the maximal ideal ($x^2+2)$), but it is not prime in $\mathbb Z[x]$, since $2x^2+4\in(2x^2+4)$, but $$2,x^2+2\notin (2x^2+4).$$
Best Answer
To dramatize the flaw in the definition given in the text by "Khanna & Bhambri" (K &B), consider the polynomials $$x,\;2x,\;3x,\;6x$$ By K&B's definition, the above polynomials are all irreducible in $\mathbb{Z}[x]$. Moreover, since none of them is a unit factor times one of the others, they would be regarded as distinct irreducibles (i.e., none is an "associate" of any of the others).
But then the polynomial $6x^2$ factors in $\mathbb{Z}[x]$ in two different ways
$$6x^2 = (2x)(3x)\qquad\text{and}\qquad 6x^2 = (x)(6x)$$
as a product of irreducible elements, thus breaking "unique factorization".
As I mentioned in my prior comment, it appears that the K&B text (perhaps accidentally) conflated irreducibility in $\mathbb{Z}[x]$ with irreducibility in $\mathbb{Q}[x]$.
I would regard it as an error, and use the standard definition instead (e.g., Gallian's definition), but check to make sure your teacher agrees.
In any case, good catch!