From the Super Mario Wiki
The Resident Demon is a large skeletal demon/ghost found in Donkey Kong 64.
The Resident Demon is found in the Ghost Train Ride, a mini-quest in the area Creepy Castle. After Donkey Kong uses his Gorilla Grab on several levers in the Skull Cave, he gains access to the Ghost Train Ride.
The Resident Demon attempts to attack Donkey with its disembodied claws, each hit from it causes Donkey Kong to lose some of the coins he has collected. It can not be hurt in any way; Donkey Kong must avoid its slashes and punches by jumping from rail track to rail track. It also fires some Skull Carts, which carry TNT Barrels when Donkey Kong reaches an area with three rails that are next to each other.