The plaintiff shall, within 30 days after final judgment, pay the sum of money assessed. If the use is for railroad purposes, the plaintiff may, at the time of or before the payment, elect to build the fences and cattle guards. If the plaintiff so elects, the plaintiff shall execute to the defendant a bond, with one or more sureties to be approved by the court, in double the assessed cost of the same to build such fences and cattle guards within eight months from the time the railroad is built on the land taken. If the bond is given, the plaintiff need not pay the cost of the fences and cattle guards. In an action on the bond, the plaintiff may recover reasonable attorney fees.