function get_user_role($id)
{
    $user = new WP_User($id);
    return array_shift($user->roles);
}
$user = get_queried_object_id();
$user_role = get_user_role($user);