Local rail systems you can sometimes use cash with the machines (varies by system, I don't know anything about the Chicago area), but if you want to pay cash with Amtrak you have to go up to the window. Buying a debit card then using that could work though as long as it runs on one of the main credit card companies' systems, I use my visa debit card from my bank in them semi-frequently.
Re: ticket machines
So this is real life