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 $0Comment: 11 pages, 6 figures, 1 table. Accepted for publication in ApJ