How can I exclude rows from two tables whose values are encompassed by each other?
According to you question, I think this is what you want:
select * from #TableB b 
where not exists (
    select 1 from #TableA a 
    where b.StartPos between a.StartPos and a.EndPos
    and A.RID = b.RID
)
union
select * from #TableA a 
where not exists (
    select 1 from  #TableB b
    where a.StartPos between b.StartPos and b.EndPos
    and a.EndPos between b.StartPos and b.EndPos
    and A.RID = b.RID
)
;

Fiddle