It has a cost but most people involved are not paid. Referendums are uncommon but that has more to do with political culture than costs I think.
We just had presidential elections and are electing representatives for parlement next week, we had local elections in 2020, nation-wide elections are not that rare.
Having mandatory voting would mean that non votes don't screw up the results when one side manages to mobilize morw voters than others. And intentionally voting blank actually sends a pretty strong signal.
Sure, they don’t vote for judges and sheriffs and stuff, and it’s a system that’s more representative than participative as in, say, Switzerland. But it works.
One of the things that helps is that voting happens always on Sundays, when most people do not have to take a day off work to vote or to help counting.
- substantial social services that don't directly require individuals to have disposable income and aren't tied directly to employment
- humane policies for vacation days in general, and
- national holidays for things like election day.
In the USA, we teach our children that civic engagement is important, but then corrupt politicians at all levels make civic engagement as hard as possible, abetted by moralizing reactionary conservatives.
No wonder Americans are generally cynical and don't participate in politics.