Undefined $post in wp_query

The most reliable way to get the current post being viewed is not the global $post variable. Instead you should first check is_singular(), and then use get_queried_object() to get the post object, or get_queried_object_id() to just get the ID.

if ( ! is_singular() ) {
    return;
}

$post_id = get_queried_object_id();

$args = array(
    'post_type'      => 'resources',
    'category__in'   => wp_get_post_categories( $post_id ),
    'posts_per_page' => 3,
    'post__not_in'   => array( $post_id )
);

// etc.