Take a look over the map for Stardust Speedway Zone 3 Good/Bad depending on which path you took. Remember several key factors about racing Metal Sonic. If you are behind Metal Sonic and see him bend over, he will soon start moving slowly with an electric force field around him. If you are in front of Metal Sonic, instead of placing an electric force field around himself he will move forward at a fast pace with a yellow aura. You can't get too far ahead of Metal Sonic. No matter how fast you move, he will catch up to you by using his yellow aura move. Metal Sonic does not ever jump. When he gets to spikes, he just goes through them. You can't just stay behind Metal Sonic the entire time and take over at the end of the race. Dr. Eggman follows you two while you're racing and gets closer and closer till he is right behind Metal Sonic. If Dr. Eggman gets directly above you, he will kill you instantly with his laser.
Once you start the level, grab the coins behind you. Walk over to the loop-de-loop, but do not go through it. Turn around, and go into the dash by holding +. Now let go of the dash and jump when you hit the top of the ramp that you are running on to jump onto a platform that has an extra life and a pair of speed shoes. Grab the speed shoes and make your way as far right as you can go at the moment. You'll be sitting there with Metal Sonic and Dr. Eggman overhead. Stand against the wall and go into the dash move once again by holding +.
The second the wall opens, take off and jump when you start going up the first ramp you hit. You should launch pretty far, and now will land on another ramp, which you can once again launch far off of. Your speed shoes will have expired by this time so the rest of the level will consist of paying attention to where the spikes are and where Metal Sonic is adjacent to you. It's a short level and if you don't beat it the first time you can do it a couple of more times and memorize the level to make it easy. Once you get to the end of the level, the road will straighten out. When it straightens out, wait behind Metal Sonic until he activates his shock force field, and jump over him. You should have enough time while he's using his force field to make it to the finish line before him.