"Gravy train" is an idiom. It means "an easy source of undeserved income." For example, suppose a corrupt politician gave government jobs to friends, that paid them a salary, while not actually requirement them to show up for work or do much. Those friends would be "on the gravy train." If the politician lost the next election, his replacement might tell these people "the gravy train has ended."
It seems to be another one of those mysterious phrases with no provable origin or explanation.