Organic problem: acidity of benzene substituents
This isn't the answer you were looking for probably, but this is the answer you should take to heart as a chemist.

I want us to look at the difference in free energy changes between the $\mathrm{p}K_\mathrm{a}$'s in question:

\begin{array}{|c|c|}
\hline
\text{Compound} &amp; \mathrm{p}K_\mathrm{a} \\ \hline
\text{2-nitrophenol} &amp; 7.23 \\
\text{4-nitrophenol} &amp; 7.15 \\ \hline
\text{2-nitrobenzoic acid} &amp; 2.16 \\
\text{4-nitrobenzoic acid} &amp; 3.44 \\ \hline
\end{array}

$$K_\mathrm{eq} = \frac{K_\mathrm{a}}{\ce{[H2O]}}$$

$$\Delta \Delta G = -RT\ln K_{\mathrm a1} + RT \ln\ce{[H2O]} - (-RT\ln K_{\mathrm a2} + RT \ln\ce{[H2O]}) = -RT\Delta\ln K_{\mathrm a}$$
$$=-2.303 RT\Delta \log K_{\mathrm a} = 2.303 RT \Delta \mathrm{p}K_\mathrm{a}$$

For $298\,\mathrm{K}$, we can compute the following $\Delta \Delta G$ values:
\begin{array}{|c|c|}
\hline
\text{Series} &amp; |\Delta \Delta G| \\ \hline
x\text{-nitrophenol} &amp; 456\ \mathrm{J}\,\mathrm{mol}^{-1} \\ \hline
x\text{-nitrobenzoic acid} &amp; 7303\ \mathrm{J}\,\mathrm{mol}^{-1} \\ \hline
\end{array}

For reference, the standard entropy of solvation for acetate is $-192\ \mathrm{J}\,\mathrm{mol}^{-1}\,\mathrm{K}^{-1}$, which at $298\ \mathrm{K}$ is equivalent to $-57\,216\ \mathrm{J}\,\mathrm{mol}^{-1}$.

Now, personally, I don't have a great handle on how the solvation of the conjugate bases are going to be relative to the benzoic acids or phenols. But you can see that solvation effects can play a huge role (and these are aqueous dissociation constants).

My personal opinion is that it's not particularly useful to understand where such a small difference comes from, particularly for the phenol series. We're talking about one-tenth of an order of magnitude. Perhaps, as you say, the benzoic acids are different because of intermolecular hydrogen bonding. I'm a bit suspicious since I don't see this acting in a differential way between the two species.

Nevertheless, the main point still stands. Acid-base equilibria in aqueous medium is a non-trivial process to understand because water is a complicated solvent. You can try to rationalize this, but you may well be wrong without very cleverly designed experiments.

And the fact of the matter is that rationalizing the difference in acidity is not that useful. Maybe if you were using linear free energy relationships, but in that case, you know there is a difference, and that's more important.

Again, as I said at the beginning, this is probably not the answer you wanted, but I think you should be trying to understand the limits of what is useful/practical to know.