Any railroad failing or refusing to comply with this part is subject to a penalty of one hundred dollars ($100) for each violation. This penalty shall be enforced and collected as provided by this part. Any judgment rendered for such penalty may also contain an order by the court directing compliance.