When you call query_posts($query);
in your second template, you overwrite the global variable that WordPress uses to return the correct values for the is_
conditionals. You should basically never use query_posts
in the template. For secondary loops, use a new instance of WP_Query
instead.