set terms to category and subcategory

I figured it out
first set the terms to post through wp_set_object_terms and then run a update query in term_taxonomy table and set parent id of the the second term to first term.

$taxo = wp_set_object_terms( $news_arr[0], utf8_encode($news_arr[2]), 'vehicle_models', $append = false ) ;
$child = wp_set_object_terms( $news_arr[0], utf8_encode($news_arr[3]), 'vehicle_models', $append = true ) ;
$category_parent    = get_term_by('name', $news_arr[2], 'vehicle_models');
                    $category_child     = get_term_by('name', $news_arr[3], 'vehicle_models');
                    $category_parent_id = $category_parent->term_id;
                    $category_child_id  = $category_child->term_id;
                    $wpdb->update( 
                    $wpdb->prefix.'term_taxonomy', 
                    array( 
                        'parent' => $category_parent_id,

                ), 
                array( 'term_id' => $category_child_id ) 

            );