I went to Stockholm last week for a couple of days, worried that I didn't have any local currency. It turned out that nobody takes cash, so everything worked out fine.
See also, subway stations in Japan, which IIRC operate under a similar model.
Free transit is a terrible idea because e.g. it means tourists don't contribute and anyone who passes a tax cut will have defunded it without the actual users being able to help.
This is literally how they get around - asking those who can pay the fare to subsidize them doesn't seem like that much to ask.
Instead you need an app installed on your phone (alipay or wechat), where you transfer cash into the app in advance. All with Chinese as the only language. (From what i heard, there now is a tourist-version of alipay in English. Last time i tried it was mostly Chinese)