If it appears that the necessity for the drainage of land adjacent to the right-of-way of a railroad is caused by the failure of the railroad to have a sufficient opening in its embankment or any other defect in construction, then the expense of the drainage shall be assessed wholly against the railroad; otherwise it shall be assessed against the complainant, except where the necessity for the drainage is partly attributed to the railroad. In that event the expense shall be apportioned between the railroad and the complainant in an equitable manner.
SDCL 49-16A-69