From the Super Mario Wiki
Brick Monsters are enemies in the game Mario vs. Donkey Kong. They attack by dropping bricks onto Mario's head. Mario must pass through the path with the handstand move so that the falling bricks hit his feet. Brick Monsters are always located in inaccessible spaces, and therefore cannot be defeated.