From the Super Mario Wiki
Moleville Mountain is a minigame in Super Mario RPG: Legend of the Seven Stars. It involves Mario riding a mine cart on the tracks. Mario controls the cart by leaning the direction he wants it to travel. If he fails to lean or is going too fast, he will crash on the corners, losing time. During the minigame, Mario collects mushrooms to use as a speed boost and coins that he can keep after the minigame. The first run through this minigame is mandatory and part of the story. Later, the moles make a tunnel directly to the game and charge 10 coins to access it (Mario can still reach it through the Coal Mines as well). The moles keep a record of Mario's time and reward him every time he beats his record.