You can loop through ids and use wp_update_post() to update stautus. Here’s a list of wc order statuses.
$order_ids = [ 638, 637, 636, 635, 634 ];
foreach( $order_ids as $id ) {
wp_update_post([
'ID' => $id,
'post_status' => 'wc-completed'
]);
}
CLICK HERE to find out more related problems solutions.