The plaintiff shall deposit with the court any money required by law as a condition to the exercise of the power of eminent domain; and, although not so required, may take a deposit when permitted by statute. In such cases, the court and attorneys shall expedite all proceedings, including those for the distribution of the money so deposited and for the ascertainment and payment of just compensation. If the compensation finally awarded to any defendant exceeds the amount which has been paid to him on distribution of the deposit, the court shall enter judgment against the plaintiff and in favor of that defendant for the deficiency. If the compensation finally awarded to any defendant is less than the amount which has been paid to him, the court shall enter judgment against him and in favor of the plaintiff for the overpayment.