Search for neutral resonances decaying into a Z boson and a pair of b jets or tau leptons