In small world, can builder ghouls still build castles when they are in decline?
There is no builder ability in the base set.  It sounds like you're talking about the Fortified ability?

The rules for Fortified state you can put down one fortress per turn while active.  Here's the full text from the rulebook - 


  Once per turn, as long as your Fortified Race
  is active, you may place 1 Fortress in a
  Region you occupy. The Fortress is worth 1
  bonus Victory coin at turn's end, unless you
  are In Decline. The Fortress also augments your Region's
  defense by 1 (just as if you had an additional Race token
  stationed there), even if you are In Decline.
  Remove the Fortress if you abandon the Region
  or when an enemy conquers it. There can only
  ever be a maximum of 1 Fortress per Region,
  and a maximum of 6 Fortresses on the map.


The fortresses stay when you enter decline, but the ability to construct new does not.  And yes, it's the same even if you have Ghouls in decline; being able to continue attacking with them doesn't change how the ability works at all.