The EU’s border agency said it had assisted Greek authorities in providing immediate aid to the migrants, who were mainly from Afghanistan and Syria.