How to show given products only using product id array from specific category page in woocommerce

Maybe I somehow misunderstood your question, but you don’t need the tax_query for that, just use the

$ids = array( <ID1>, <ID2>, ... );
$q->set( 'post__in', $ids );