A monosubstituted benzoic acid is stronger than a monosubstituted phenol as former being a carboxylic acid. Among the given substituted benzoic acid, ortho-hydroxy acid is strongest acid although - $\mathrm{OH}$ cause electron donation by resonance effect which tends to decrease acid strength. It is due to a very high stabilization of conjugate base by intramolecular $\mathrm{H}$-bond which outweight the electron donating resonance effect of $-\mathrm{OH}$.
The overall order of acid-strength of given four acids is ortho-hydro $x y$ benzoic acid $\left(p K_a=298\right)>$ Toluic acid $\left.p K_a=4.37\right)>p$-hydroxybenzoic acid $\left(p K_a=4.58\right)>$ $p$-nitrophenol $\left(p K_a=7.15\right)$.