Whenever any real property situate in any district which has availed itself of the provisions of Section 12897 has been sold for taxes and has been redeemed, the money paid for redemption shall be apportioned and paid to the district by the county treasurers receiving it in the proportion which the tax due to the district bears to the total tax for which the property was sold.