In the event any person, persons, firm, corporation, or governmental body shall bring any action whatever to contest the validity of any of the tax foreclosure proceedings, under either section 77-1933 or 77-1934, then such person, persons, firm, corporation, or governmental body shall first pay to the clerk of the district court in which the action shall be brought all taxes levied or assessed against real estate for the years foreclosed on, with interest and penalties provided by law, and all court costs in the tax foreclosure proceedings taxed in the cause of action affecting the real estate involved in the subsequent action, and shall also pay to the county treasurer of the county all taxes levied or assessed against said real estate subsequent to the taxes foreclosed upon, with interest and penalties provided by law, which are liens upon the property at the time such subsequent action shall be commenced. The money paid to the county treasurer as subsequent taxes shall be held by the county treasurer in escrow until there has been a final adjudication as to the validity of the tax foreclosure proceedings under attack, and not unless and until such proceedings have been adjudicated to be invalid shall the county treasurer distribute the subsequent taxes thus paid to the state and governmental subdivisions entitled to participate therein. The payment of such taxes and court costs shall be a prerequisite to the filing of any such action. In the event the party bringing action to contest the validity of such tax foreclosure proceedings is unsuccessful, the clerk of the district court shall refund to such party, after deducting all unpaid costs assessed against him by the court in such action, the balance remaining after such deduction of the amount of any costs and taxes paid to such clerk as a condition precedent to institution of such action. The county treasurer shall also refund all subsequent taxes paid by such party in the event he is unsuccessful.