A taxi, even if shared, will be (much) more expensive than making the route by bus or MD train so if you aren't in a rush and if you don't arrive to A Coruña after the departure of the last train and/or bus, you may consider the option of going by buses or train(s) instead of by taxi.
By bus, AFAIK, you have to change buses in Lugo. www.arriva.gal makes the route from A Coruña to Lugo and www.monbus.es from Lugo to Sarria
By train, you can make the route either direct or changing trains in Lugo. Take a look at www.renfe.com for info about schedules and fares (and ticker purchase if you were interested).