Part 1: The Demon Train
After defeating the evil trains on the tracks in the dark realm, you'll find yourself on a set of tracks, going north. There are four northbound tracks on the screen, and from time to time there will be a connection going from your track to one of the neighboring tracks.
Soon the Demon Train will appear. Be sure to stay out of its way, or you'll get hurt. Definitely get out from behind it if you end up behind it, because there's no way to fight the Demon Train from behind. And remember, there are skulls around the tracks, so shoot these with your cannon if your train needs hearts.
Be careful, also, of floating fireballs that sit on the tracks. These will hurt you if you go through them. The top screen will show you which track you will end up on whenever you're about to get to an intersection.
Travel alongside the Demon Train, and in the first part, it will open up hatches in its rear car. It will spit out explosive powder kegs at you if you aren't quick. Shoot those kegs with your cannon while the kegs are still in the Demon Train. If you make the keg explode while it's still in the Demon Train, it will damage the Demon Train. Once you have made all of the powder kegs explode, the rear car of the Demon Train will explode and fall off, and you'll go through a portal.
With the rear car of the Demon Train now gone, you will have to follow the train again, this time shooting the laser cannons in the sides of the next rear car. Shoot each one twice to destroy it. Once you do that, that car of the Demon Train will explode and fall off, and you'll go through another portal.
Now, the engine of the Demon Train is all that is left. It will shoot lasers at you from the rotating parts. Disable all of these with your cannon, and then speed up to get in front of the Demon Train. Shoot your cannon at the Demon Train's face as many times as possible. Repeat this until the Demon Train is defeated.
Part 2: Cole and Zelda-Malladus
After the Demon Train is defeated, you'll be back in your train with Anjean and Byrne. Anjean summons a Phantom for Zelda to inhabit during the upcoming battle. Then Link and Zelda climb onto the top of Demon Train, where Cole floats around and Zelda-Malladus stands at the far end of the train.
Your objective is to have Phantom-Zelda attack Malladus. Cole will float around, sending magical rats at Zelda. Since Zelda is afraid of rats, they will make her become scared and stop walking. So Link needs to kill the rats while directing Zelda toward Malladus at the end of the train.
If one of the rats touches Zelda, Cole will control her like a puppet, making her walk toward Link and hit him with her sword. Run downward to stay out of range. To get control of Zelda again, you can use the boomerang to cut the puppet strings.
Once you and Zelda get closer to the front of the train, Malladus will start shooting a red energy beam at Zelda. She is immune to it, but if Link walks in front of Zelda, Malladus will shoot the beam at him instead, so make sure not to have Link walk in front of Zelda, not even to cut the puppet strings.
Keep moving Zelda forward, killing the magical rats as you go. Note that the rats give off hearts and arrows, so make sure to use those if you need them. Once Zelda is close to Malladus, she can walk forward and grab onto Zelda-Malladus by drawing a line onto her to target her.
Once Zelda grabs Malladus, the two will float in the air in front of the train. Phantom Zelda will struggle and spin around while holding Malladus. Charge up a Light Arrow and shoot it at Malladus to defeat this form of Malladus.
Part 3: Final Form of Malladus
The Demon Train will crash and you will be back in the Forest Realm, somewhere on land. Malladus has departed from Zelda's body, and before it can possess her again, Byrne stops the evil spirit in mid-air. Zelda calls on the power of her ancestor Tetra to return to her body. Malladus destroys Byrne and then consumes Cole, taking over his body.
Zelda, back in her body, is able to build up power within herself, which will make it possible to kill Malladus. But she needs some time to build up that power, so Link has to protect her from Malladus while she does that. Malladus will shoot fireballs at Zelda. Link will have to use his sword to deflect those fireballs. Sometimes a fireball will leave a heart behind after Link deflects it, so be sure to collect all of the hearts you need. Thanks to Tetra's power, Zelda can't be killed, so you can keep trying as many times as you need while you get through this part as long as Link stays alive.
The first fireballs are not that hard to deflect. Just tap each fireball and Link will chop it out of the way. After sending some fireballs straight to Zelda, Malladus will spit a couple of fireballs at an angle away from her. When the fireball gets next to Zelda, it will shoot sideways at her. Keep alert for when Malladus shoots fireballs at an angle away from Zelda so you can keep these away from her.
Sometimes, Malladus will jump back to the center of the screen, then he will take a deep breath and spew four fireballs at once. To get rid of these, you need to do a spin attack, and you need to time it just right to cut them all out of the way before they can hit Zelda.
After a while, Zelda will start glowing so brightly that the rest of the screen gets a little darker, and the background music will become quieter. Malladus will rapidly spit some fireballs at you, and then he will return to the center of the screen, taking a deep breath. Now, this will be easier if you have the Great Spin Attack, which you can get from Niko after you get the stamps from all twenty stamp stations. Otherwise, you will have to be more careful with the timing.
Malladus is going to shoot four fireballs at once, and then he'll shoot four more right away. So you need to wait to start the spin attack until just before those four fireballs hit you. Then do spin attacks over and over, which will start the Great Spin Attack if you have it. If not, hopefully doing several normal spin attacks will do the trick, and that should take care of those fireballs.
Hopefully, by now Zelda has finished charging up her power. Once she does, she will turn to you and say that you must play along with the Spirit Flute while she sings a magical song. The tune is Orange-Purple-Yellow-Turquoise-Orange. It is pretty tricky, but just keep trying. Play your part of the tune when the top screen is focused just on Link. When you have done it correctly, the Lokomos will appear on the screen, playing along with the tune.
When the song is over, Malladus will have a new vulnerability: a shining spot on his back. Zelda will take up the bow, and a button will appear at the bottom of the lower screen in the middle that has a picture of an arrow. Zelda will take care of aiming at Malladus's back, but it is up to Link to get Malladus to leave Zelda alone.
Have Link go in front of Malladus's face, hitting him with your sword to get his attention. Make sure that Malladus is following you and not running toward Zelda. Then get Malladus to face away from Zelda so that his back is facing her. If Zelda does NOT have a clear shot at the vulnerable spot on Malladus's back, the targeting thing will be purple. But when Zelda DOES have a clear shot, the targeting thing on his back will change from purple to yellow. When the targeting thing on his back is yellow, tap the arrow symbol on the lower screen and Zelda will shoot at Malladus. Now you'll need to distract Malladus again and repeat the process.
After three arrow shots, Malladus will collapse. Hit his head until you break off a horn. Repeat this, and eventually you will get rid of those horns, revealing a crystal on his head. Swing your sword at it and you will stab right into it. Rub your stylus back and forth to keep the sword in place while Zelda runs over to help you deliver the final blow.
Congratulations!! You won the game!