I haven't played enough Layton to really give a fair judgment and what's worse I haven't even touched Apollo Justice but comparing my limited time (2 hours) with Layton to Phoenix Wright 1 and 2 I'd say Phoenix Wright is the better game.
Layton is fun and all but it just seems to be a bunch of puzzles chained by a story, the puzzles are pretty great but they drive the story and not the other way around. PW on the other hand is driven by it's story and the solution to it's puzzles is tied to the story (obviously), for this, I think PW deserves the vote.
But I might change my opinion once I finish Layton so who knows.
Voted Apollo Justice but really you can't go wrong with either one. I prefer the puzzles in Professor Layton and in its defense I've only played about 3 hours of it so far. That being said, having played the first 3 Ace Attorney games I think it's safe to say that I'll probably enjoy Apollo Justice just slightly more.