law: Railways Act, 1989
  140. Security for good behavior in certain cases. 
  (1) When a court convicting a person of an offence under section
  
  137 or section 138 finds that he has been habitually committing or attempting
  
  to commit that offence and the court is of the opinion that it is necessary or
  
  desirable to require that person to execute a bond for good behavior, such
  
  court may, at the time of passing the sentence on the person, order him to
  
  execute a bond with or without sureties, for such amount and for such period
  
  not exceeding three years as it deems fit.
  (2) An order under sub-section (1) may also be made by an
  
  appellate court or by the High Court when exercising its powers of revision.