Include post_status check within $wpdb query

Short Answer

To get the post status, you’ll need to JOIN the posts table based on the post_id you grabbed from wpm1 or wpm2 and extend your WHERE clause to use that joined data.

Recommendation

On the other hand, instead of going directly to the database to get your content, you could use WP_Query to process this content. See below for a quick example. I highly recommend testing this code before adding it to your site.

<?php
$args = array(
    'fields' => 'ids',
    'posts_per_page' => 1, // This is a heavy-handed approach to limit result to one
    'meta_query' => array(
        array(
            'key'     => 'review_product',
            'value'   => $this->post->ID,
            'compare' => '=',
        ),
    ),
);
$query = new WP_Query( $args );
$all_ids = $query->posts[0]; // Most likely want to change this to a foreach so you can find the right value

$args2 = array(
    'fields' => 'ids',
    'meta_query' => array(
        array(
            'key'     => 'review_rating',
            'value'   => $all_ids,
            'compare' => '=',
        ),
    ),
);
$query2 = new WP_Query( $args2 );
return $query2->post_count;