When do routed units capture a castle/stronghold
Yes, even routed units immediately control the areas they occupy.

According to the FFG rule book, 


  Controlling Areas - A House is said to control a land area when it has at least one Footman, Knight, or Siege Engine in the area, or has previously established control in that area by placing a Power token there (see below).