just because a company like Uber can profit from it doesn't mean that a city can do it themselves for cheaper.
I think you underestimate economies of scale and the value Uber can provide, and also underestimate the cost of DIYing it and upkeep.
edit: like, especially if the town is really small and the app gets low utilization, isn't it better to pay a fixed % on top of each ride (say 50%) to uber than to have to pay someone a full time salary for a year to maintain things.