A search for a heavy Higgs boson H decaying into the observed Higgs boson h with a mass of 125 GeV and another Higgs boson hS is presented. The h and hS bosons are required to decay into a pair of tau leptons and a pair of b quarks, respectively. The search uses a sample of proton-proton collisions collected with the CMS detector at a center-of-mass energy of 13 TeV, corresponding to an integrated luminosity of 137 fb−1. Mass ranges of 240–3000 GeV for mH and 60–2800 GeV for mhS are explored in the search. No signal has been observed. Model independent 95% confidence level upper limits on the product of the production cross section and the branching fractions of the signal process are set with a sensitivity ranging from 125 fb (for mH = 240 GeV) to 2.7 fb (for mH = 1000 GeV). These limits are compared to maximally allowed products of the production cross section and the branching fractions of the signal process in the next-to-minimal supersymmetric extension of the standard model