Ghost T. is a deceased Toad in Paper Mario: The Thousand-Year Door who had passed away on the Excess Express many years before the game's setting and now exists in limbo between this world and the next (in cabin 004, to be precise). The name "Ghost T." is a pun on "ghosty", which is a diminutive of "ghost". Of course, the T. stands for "Toad".
In order to get Ghost T. to appear, Mario must enter room 004, and use Vivian's Veil move and wait a moment; Ghost T. will then appear inside room 004. He will also not appear until Mario is tasked with finding the missing blanket no matter how long the player hides for.
As with many ghosts, he is trying to resolve earthly conflicts before moving on to the next life. He lingers on the train because he left his Diary in the baggage car and does not want anybody except himself to read it. Mario retrieves the diary for him and gives it to Ghost T. Soon, a column of light shines on the specter, and he begins to ascend into the next world. However, he stops partway up, deciding to stay in the earthly realm; his reason for staying is that he likes the wallpaper of his train cabin. He died on the Excess Express because the dish he ate in the dining car had a Poison Shroom in it. Ghost T.'s death did not affect the seemingly famous train, and even reading his diary (see below) reveals no information beyond stating that Ghost T. "got on a train" at an unknown time and ending with the phrase "And on that train...".
He has a side-quest to offer. The conductor will state something about a "person with no ticket" on board, holding onto some blanket. He asks to retrieve the blanket. Talk to Ghost T., and he will give Mario (or show him actually) the Blanket for an exchange. He left his Diary on board and he wants no one to read it. The diary is located in the Baggage area, right behind the Conductor. Its located behind some boxes labeled "Food" in a tight spot (reachable via Paper mode). Bring him back the Diary, and Mario will get the blanket the Conductor wants.
Ghost T. specifically warns Mario not to read the diary, or else he will suffer a cursed fate. If Mario does open it, he will be warned three times not to read it. Should he ignore all the warnings, Mario will only be able to read the first couple of lines before Ghost T. appears from the Diary and yell at Mario for his ignorance, and forces him to suffer: the screen will start spinning, the screen's curtains will close and re-open with Mario on the ground, defeated, with an automatic Game Over.
It is unknown exactly what happens to Mario as a result of reading the Diary. When Mario returns the diary to the ghost, however, he is told that if he had read it he would have become a ghost.
Later on in Paper Mario: The Thousand-Year Door, Ghost T. writes an e-mail to Mario. He does so by possessing the Conductor of the Excess Express, as he cannot hold physical objects (something he himself notes to Mario upon first meeting with the plumber). Also, he somehow managed to leave a note on Rogueport's bulletin board, possibly by possessing the conductor (or someone else) yet again.
Along with Heff T., Ghost T. stays on the Excess Express for the remainder of the game.