Judging by their attitudes/actions in their respective episodes, I reckon Q would make short work of Trelane, even though Trelane may in fact be his forefather. Trelane certainly had his fair share of power and dangerousness, but technically he was a child - clumsy, easily manipulated, and not quite fully confident and in control of his own potential force. Q, on the other hand, was completely sure of himself and therefore, a much more formidable adversary, and it usually took considerably more complicated thinking and/or action on the part of the crew to defeat him than it did Trelane.