Vote came shortly after G7 leaders failed to agree on a joint statement condemning Russia’s war