Get the term for an taxonomy archive when the term has no posts

You could simply check if a post exists. Otherwise, you can get the currently viewed term:

// Check if we have posts to work with
if( ! have_posts() ) {
    $term = get_queried_object(); // Get the current term
}

// Check if we have a term to work with
if( ! empty( $term ) ) {
    echo $term->name; // Output term properties
}

Since you’re using this in a taxonomy template, get_queried_object() should return a WP_Term object.