How to exclude child elements when looping through categories?
Rather than preparing multiple queries - you can execute the Query in your field value 

{% for category in craft.categories.group('categoryGroup').level(1).find() %}
    {% for resource in category.fieldHandle.find() %}
        {{ resources.title }}
    {% endfor %}
{% endfor %