  As an important candidate gravity theory alternative to dark energy, a class
of $f(R)$ modified gravity, which introduces a perturbation of the Ricci scalar
$R$ in the Einstein-Hilbert action, has been extensively applied to cosmology
to explain the acceleration of the universe. In this paper, we focus on the
recently-released VLBI observations of the compact structure in
intermediate-luminosity quasars combined with the angular-diameter-distance
measurements from galaxy clusters, which consists of 145 data points performing
as individual cosmological standard rulers in the redshift range $0.023\le z\le
2.80$, to investigate observational constraints on two viable models in $f(R)$
theories within the Palatini formalism: $f_1(R)=R-\frac{a}{R^b}$ and
$f_2(R)=R-\frac{aR}{R+ab}$. We also combine the individual standard ruler data
with the observations of CMB and BAO, which provides stringent constraints.
Furthermore, two model diagnostics, $Om(z)$ and statefinder, are also applied
to distinguish the two $f(R)$ models and $\Lambda$CDM model. Our results show
that (1) The quasars sample performs very well to place constraints on the two
$f(R)$ cosmologies, which indicates its potential to act as a powerful
complementary probe to other cosmological standard rulers. (2) The $\Lambda$CDM
model, which corresponds to $b=0$ in the two $f(R)$ cosmologies is still
included within $1\sigma$ range. However, there still exists some possibility
that $\Lambda$CDM may not the best cosmological model preferred by the current
high-redshift observations. (3) The information criteria indicate that the
cosmological constant model is still the best one, while the $f_1(R)$ model
gets the smallest observational support. (4) The $f_2(R)$ model, which evolves
quite different from $f_1(R)$ model at early times, still significantly
deviates from both $f_1(R)$ and $\Lambda$CDM model at the present time.
