I am not sure M-PESA has failed in Tanzania.
IMO, M-Pesa's failures in other countries stems from regulatory approach, where banks in those countries, after seeing what M-Pesa was capable of, lobbied the regulators in the country to over-regulate the product, which in result means that there is little use case for it.
In SA, M-Pesa is run off a bank whose clientèle is mostly well off.