Initialize an array before the first loop:
$exclude = array();
Then add the ID of each post within the first loop to that array:
while ($query->have_posts()) {
$query->the_post();
$exclude[] = get_the_ID();
// etc...
Then use that array to exclude those IDs via post__not_in
in the second query:
$args = array(
'post_type' => 'page',
'post__not_in' => $exclude,
// etc...