That line if thinking was "shot down" back in the 1980's when apartment complexes quit accepting cash due to theft risk - it was upheld in court.
Wrong. me_little_me's analysis is exactly correct.
If you have already received the goods or services (so, you've incurred a debt), and did not specifically contract to pay in another form (gold, Bitcoin, Tesla stock, whatever), then you can offer to pay your debt in cash and they have to take it or forgive the debt.
If you have not recieved the goods or services yet (which is *always* the case when buying train tickets) then they can refuse to take cash. (No, you can't get around this by getting on the train without a ticket and then trying to pay for a ticket. For that, they can just throw you off the train.)
Most apartment complexes bill for rent BEFORE the month for which the rent is. If they billed AFTER the month you were present -- billing in arrears -- then they would have to take cash. But they don't. So, if you fail to pay your rent on time, and then later offer cash to cover the *debt* you incur, they have to take it or forgive the *debt* -- but they can still evict you for not paying your rent on time.
When you start looking into it, you'll discover that there are relatively few circumstances under which you generate a *debt* by receiving goods or services, legitimately, before paying for them. Sit-down restaurants are one. Construction contractors and repairmen are another. I can't think of a third common example. Almost all businesses have moved to pay-up-front, and most of those who haven't (in the business-to-business sector) specify form of payment in their contract (which overrides the legal tender laws).