From the Super Mario Wiki
During gameplay in Button Barrel Blast, these special, but rare, barrels can be used to cross large gaps. The barrels, used in a similar manner to Barrel Cannons, usually aim off-track, so the Kongs have to use nearby buttons to move them. Each time the button is hit, the large barrel will turn slightly to the right or left. When the Button Barrel aims at the correct target, the two heroes can jump inside of it and fire into the air.
Additionally, Button Barrels appear in certain Bonus Levels of the game. When seen in one of these bonuses, they automatically move quickly across the area. Hitting the button nearby controls the barrel, as usual, though it can not aim it. Instead, one of the apes' Kong Tokens will shoot out of it. If this token is caught as it flies across the small area, the group will be granted with an extra life.