Nitrogen in structure a and c is sp3 hybridised whereas, in structure b and d is sp2 hybridised. d is less basic because lone pair participate in conjugation.
Whenever lone pair participates in resonance, it is less available for donation hence it decreases the basicity of compound.
Lone pair present at sp3 hybridized nitrogen will be more available as compared to the lone pair present at sp2.