Use NOT EXISTS.
select * from agents a
where railenabled = 1 --assuming 1 means enabled
and not exists (select 1 --not exists to remove all agents whose users have RAL enabled
from userpermissions b
where a.companyid = b.companyid
and b.modulecode = 'RAL'
and b.enabled = 1
);