We present precise measurements of the X-ray gas mass fraction for a sample of luminous, relatively relaxed clusters of galaxies observed with the Chandra Observatory, for which independent confirmation of the mass results is available from gravitational lensing studies. Parameterizing the total (luminous plus dark matter) mass profiles using the model of Navarro, Frenk & White (1997), we show that the X-ray gas mass fractions in the clusters asymptote towards an approximately constant value at a radius r_2500, where the mean interior density is 2500 times the critical density of the Universe at the redshifts of the clusters. Combining the Chandra results on the X-ray gas mass fraction and its apparent redshift dependence with recent measurements of the mean baryonic matter density in the Universe and the Hubble Constant determined from the Hubble Key Project, we obtain a tight constraint on the mean total matter density of the Universe, Omega_m = 0.30^{+0.04}_{-0.03}, and measure a positive cosmological constant, Omega_Lambda = 0.95^{+0.48}_{-0.72}. Our results are in good agreement with recent, independent findings based on analyses of anisotropies in the cosmic microwave background radiation, the properties of distant supernovae, and the large-scale distribution of galaxies.