About the only wiggle room is if Trelane were observing Earth via FTL, but not instantaneous FTL. Given his godlike powers, there's no reason to assume that he'd be limited to lightspeed observation of Earth. He catches up to the Enterprise
and maneuvers Gothos at warp, after all. The blunder could simply be in Kirk and crew, Trelane's fault being not for his lack of raw power, but for allowing the crew's confusion to confuse him. Or maybe Trelane just enjoyed playing the fool. A bit of a fanwank, I admit, but there's a circle to square here.