From the Super Mario Wiki
The Mushroom Derby is a race that takes place on Yo'ster Isle in Super Mario RPG: Legend of the Seven Stars. Mostly, only Yoshis participate in the Mushroom Derby (however, the Yoshis may have riders accompany them during the race). The steps in the race have to follow the music that is playing in the background. A Yoshi can boost its speed with a Yoshi Cookie. The winner also gets cookies rewarded.