The TSA does not prohibit people from taking their own supplies of such items on trains. Yet.
Nor do they airplanes. Buy all you want after going through security.
Also, to Clue's point, Amtrak does charge a change/refund fee now. They have for several years. I'm on Amtrak several times a month, I know the drill.