This is already the case. A lot of transit agencies have a vanpools, rideshares, and ridehales for their low frequency areas. I used one recently in Tacoma because my ferry was late and the bus from the ferry arrives only ones an hour.
I will say it was super nice. However, I would prefer a regular and a direct bus any day. Being able to just walk into a bus, scan my transit card and get on with my day is a much preferable experience then to order a ridehail via an app.
So if a transit agency can just increase their bus frequency, they should. They should not however pass the limited funds they do have over to a private company.