This is the scene for where Megatrain explains his disappearance and how Tirek betrayed him, and where he kill Tirek and he regains his Arc. In Thomas' Place as a Prime.
Megatrain: [takes his fusion, plasma cannon and points it a Tirek and cocks it]
Megatrain: It's a new era Tirek, there's no room for guys like you when there's guys like me. Especially when guys like you betray me!
Princess Celestia: What?
Brian: What the heck do you mean by "betray you?"
Megatrain: Ah, I see Tirek didn't tell you. Well, years ago I resurrected Tirek hoping to regain my power.
Shai-Shay: Hold on, you resurrected Tirek?
Mako: But that wall in Shangri-La said Unicron did.
Megatrain: The wall is wrong, I resurrected Tirek.
Ernie: [glares at Tirek] What's going on, Tirek?
Tirek: He's crazy! He has no idea what he's even talking about, really!
Megatrain: Oh, you know what I mean! Cue the flashback. [opens his chest and a TV comes out and shows what happened years ago]
[as the flashback plays Megatrain tells the story]
Megatrain: After I resurrected Tirek, we set off to rebuild my energy. [we see Megatrain sucking energy out dead robots the Tirek finds] Soon enough I had enough power to get to my machine when Tirek betrayed me. [We see Tirek attack Megatrain and take a blue orb out of Megatrain chest] Tirek attacked me and took my Arc out of my chest.
Princess Luna: Pray tell, what is this Arc thing?
Megatrain: My Arc is a blue glowing orb of Energon that has the ability to take energy out of dead robot bodies including Autobots, Decepticons, Trainbots, and Deceptitrains.
Applejack: Megatrain, can this Arc thang' also suck ponies dry of their magic?
Megatrain: No, it wasn't intended for that purpose, it depends on the being who posses the Arc.
Rainbow: Well that Centaur has stolen magic out of us years ago!
Megatrain: You're been using my Arc to steal magic?
Tirek: [nervously nods his head]
Megatrain: I see. [back at the others] Anyway, my Arc isn't easy to take from me, you literally have to jump onto me and open my chest and take it out. Which is what Tirek did. But if the being who has the Arc is a organism, then to get the Arc you have to kill the being.
Brian: Really, because when we killed Tirek before, why we didn't see your Arc get left behind?
Megatrain: How did you kill him before?
Dusty: We use a thing called the "Rainbow of Light."
Megatrain: Okay. Well, the reason you didn't see the Arc anyway is because when the being dies in that form, the Arc goes with the being's soul and when the soul return to the body the Arc returns as well. Anyway back with my story; after Tirek ate my Arc, he sent me to the descent prison many miles underground and I've been there for 10 years.
T.C.: So, that's where you were for those years!
Megatrain: Yes, and when Tirek blasted that tank engine who had the Matrix, Blue Ruby, and Black Pearl, it activated the spell that would release me form my prison and here I am!
Princess Celestia: Here you are.
Megatrain: Now that I told you what happened, now I can proceed. [points his cannon at Tirek] Send my regards to the king of the Big Fire Down Under!
Megatrain: [fires his cannon and Tirek explodes]
[the dust clears and Tirek is gone]
Charlie: [in Rex's voice] He's gone!
Uray: Vaporized completely!
Princess Luna: Wow!
Brian: GOOD RIDENCE!!!
Optimus: [unfreezes] Whoa, that was something.
Ed: OPTIMUS! YOU'RE NOT STATUE ANYMORE!!!
Megatrain: There it is. [a glowing, blue orb is seen] My Arc. [he picks up the Arc] Now let's return you to your rightful owner. [he opens his chest and the Arc floats inside] [cackles] Now that I have my power back, [his body now glows from the Arc sending energy through his body] I can bring back my army!
Ernie: Oh, man! I'm out of here! [runs away leavinng dust of himself]