Wp-query Order By problem

The “problem” seems to be the default value that order receives, its always DESC unless told otherwise.

You will need to create your own order after getting the posts, so something like this.

$my_query = new WP_Query($query_args);

$ordered_posts = [];

foreach(explode(',', $idpaginas) as $rpid) {
    foreach($my_query->posts as $index => $fpid) {
        if($fpid->ID == $rpid) $ordered_posts[] = $my_query->posts[$index];
    }
}

$my_query->posts = $ordered_posts;

while ($my_query->have_posts()) : $my_query->the_post();

This code was based on this question, edited it a bit to fit your needs.