The phrase “to ride the gravy train” means: To acquire wealth; become prosperous; live on Easy Street; have a profitable business or an easy or well-paid position.
Probably the expression actually arose in railroading lingo, in which a gravy run or a gravy train meant an easy run with good pay for the train crew, for gravy in popular speech, has long meant money easily earned or obtained.
Though the earliest quotation in which gravy train appears is in Benjamin A. Botkin’s Lay My Burden Down (1945), “They is on the gravy train and don’t know it, but they is headed straight for ‘struction and perdition”, even the full phrase, “to ride the gravy train,” was undoubtedly in use ten or twenty years earlier than that date, because it appears in all the above senses in The American Thesaurus of Slang which was published in 1942 and was under compilation during the preceding ten years or so.