We present a catalog of stellar age and mass estimates for a sample of 640,986 red giant branch (RGB) stars of the Galactic disk from the LAMOST Galactic Spectroscopic Survey (DR4). The RGB stars are distinguished from the red clump stars utilizing period spacing derived from the spectra with a machine learning method based on kernel principal component analysis (KPCA). Cross-validation suggests our method is capable of distinguishing RC from RGB stars with only 2 per cent contamination rate for stars with signal-to-noise ratio (SNR) higher than 50. The age and mass of these RGB stars are determined from their LAMOST spectra with KPCA method by taking the LAMOST - $Kepler$ giant stars having asteroseismic parameters and the LAMOST-TGAS sub-giant stars based on isochrones as training sets. Examinations suggest that the age and mass estimates of our RGB sample stars with SNR $>$ 30 have a median error of 30 per cent and 10 per cent, respectively. Stellar ages are found to exhibit positive vertical and negative radial gradients across the disk, and the age structure of the disk is strongly flared across the whole disk of $6<R<13$,kpc. The data set demonstrates good correlations among stellar age, [Fe/H] and [$alpha$/Fe]. There are two separate sequences in the [Fe/H] -- [$alpha$/Fe] plane: a high--$alpha$ sequence with stars older than $sim$,8,Gyr and a low--$alpha$ sequence composed of stars with ages covering the whole range of possible ages of stars. We also examine relations between age and kinematic parameters derived from the Gaia DR2 parallax and proper motions. Both the median value and dispersion of the orbital eccentricity are found to increase with age. The vertical angular momentum is found to fairly smoothly decrease with age from 2 to 12,Gyr, with a rate of about $-$50,kpc,km,s$^{-1}$,Gyr$^{-1}$. A full table of the catalog is public available online.