Phantom Hourglass is the stronger title. It's simply a better crafted, more refined experience.
With Spirit Tracks, the essence of the concept that made the original so great is gone; just what is the point of a central dungeon if the player never treads a section of said dungeon more than once? Its purpose is reduced to a narrative convenience - a structural component that does nothing in-and-of-itself to further the story or game play.
People say the sequel was better written, but that's debatable. Phantom Hourglass doubtlessly had a more developed world, and better integrated plot with game play. The subtly embedded narrative was one of the title's greatest strengths. I'm not going to take anything away from Iwamoto - the man knows his characters - but that was one thing that suffered without Fujibayashi.
However, I wouldn't mind Spirit Tracks if it wasn't so sloppily designed; the flute, for example, is a great concept, but that doesn't matter because it is so poorly implement, both as an item and as a mechanic as such.
Its use outside of story events is sporadic and poorly though out; most of the songs are short, dull, and ultimately pointless. Just what is the purported purpose of the Song of Discovery if it is only used once in the entire game (main quest) - to unearth a single chest which might as well have been dug up? Why isn't it used to summon the light pillar hidden at the entrance to the Fire Temple?
And the event songs? It's painfully obvious the developers did realize their interface was not good enough to support virtuoso music-making, hence why you do nothing but repeat the same motif over and over during these sequences. But why is it that you can't make a single mistake during an even that is 30 seconds long? Why can't you skip the metronome intro sequence? Why doesn't the game directly tell the player that the most important thing is to land the notes at the proper beats (never mind holding them to their proper length)?
I won't even go into how the flute featured in the (terrible) final battle (I had to redo that segment 20 times the first time beat the game).