I'm assuming A and B are the struct output from regionprops:
Z=false(size(BW));
Aunion=Z;
for i=1:numel(A)
Aunion(A(i).PixelIdxList)=1;
end
D=bwdist(Aunion)>=10;
discard=false(1,numel(B));
for i=1:numel(B)
Bi=Z;
Bi(B.PixelIdxList)=1;
discard(i)=any(Bi(:)&D(:)); %test for intersection
end
B(discard)=[];