  We use the dispersion measure (DM) and redshift measurements of 24 localized
fast radio bursts (FRBs) to compare cosmological models and investigate the
Hubble tension. Setting a flat prior on the DM contribution from the Milky
Way's halo, $\mathrm{DM_{halo}^{MW}}\in[5,\;80]\;\mathrm{pc\;cm^{-3}}$, the
best fit for flat $\Lambda$CDM is obtained with a Hubble constant
$H_0=95.8^{+7.8}_{-9.2}\;\mathrm{km\;s^{-1}\;Mpc^{-1}}$ and a median matter
density $\Omega_{\mathrm{m}}\approx0.66$. The best fit for the
$R_{\mathrm{h}}=ct$ universe is realized with
$H_0=94.2^{+5.6}_{-6.2}\;\mathrm{km\;s^{-1}\;Mpc^{-1}}$. We emphasize that the
$H_0$ measurement depends sensitively on the $\mathrm{DM_{halo}^{MW}}$ prior.
Since flat $\Lambda$CDM has one more free parameter, $R_{\mathrm{h}}=ct$ is
favored by the Bayesian Information Criterion (BIC) with a likelihood of
$\sim73\%$ versus $\sim27\%$. Through simulations, we find that if the real
cosmology is $\Lambda$CDM, a sample of $\sim1,150$ FRBs in the redshift range
$0<z<3$ would be sufficient to rule out $R_{\mathrm{h}}=ct$ at a $3\sigma$
confidence level, while $\sim550$ FRBs would be necessary to rule out
$\Lambda$CDM if the real cosmology is instead $R_{\mathrm{h}}=ct$. The required
sample sizes are different, reflecting the fact that the BIC imposes a severe
penalty on the model with more free parameters. We further adopt a
straightforward method of deriving an upper limit to $H_{0}$, without needing
to consider the poorly known probability distribution of the DM contributed by
the host galaxy. The theoretical DM contribution from the intergalactic medium
($\mathrm{DM_{IGM}}$) at any $z$ is proportional to $H_0$. Thus, requiring the
extragalactic $\mathrm{DM_{ext}}$ to be larger than $\mathrm{DM_{IGM}}$
delimits $H_0$ to the upside. Assuming flat $\Lambda$CDM, we have
$H_0<89.0\;\mathrm{km\;s^{-1}\;Mpc^{-1}}$ at a 95\% confidence level.
