Except that Trelane and Q have nothing in common besides attitude. Trelane needed technological assistance to do his tricks -- aside from the whole incorporeal thing, there's no indication in "Squire" that he had any powers of his own rather than using his "instrumentality" to do it all. He also fell vastly short of the omniscient perceptions of the Q, since his observations of Earth were limited by the speed of light and he was unaware of the intervening passage of time. Plus the illusions he created had only form and no substance -- they were more like holodeck constructs than the "completely real" creations of Q. Given that he needed machines to make them, they may have been quite literally the product of holotechnology or replication. Indeed, aside from moving Gothos around, Trelane didn't do anything that couldn't be achieved with 24th-century Federation technology. His abilities were parlor tricks compared to Q powers.
In the book, that is completely explained. Remember, Trelane was a child, which is the explanation David gives. As Q live billions of years, a child of theres would have an immense childhood. Without his equitment, Trelane's powers would be even more limited.
Also remember that when Trelane's parents came, they were most definently omniscient.
As for the "child" thing, it isn't the only discontinuity in Trek....
And David is, in my opinon, one of the best Trek writers to walk the face of the earth, so don't go insulting his work......