The tricky part is identifying an action that fires only when the post is first published. 'save_post' also fires when the post is updated, so is no good. The action you want is actually 'draft_to_publish', which I determined by experimenting with the 'transition_post_status' action. See the source code for wp_transition_post_status() for insight into what's going on with various actions. You may wish to experiment yourself instead of taking my word for it, I've been wrong before.
So you hook into the appropriate action with add_action(). Your action callback function is passed the post object. From that you get the post ID which you can use in wp_get_post_categories() to determine if the categories meet your criteria. If it all checks out, run your query.