Basicity of substituted pyridines
Basicity has everything to do with electron density on the electron-pair donor.  Electronegative subsituents actually decrease basicity because they draw electrons towards themselves, though nitrogen and chlorine have comparable electronegativities (3.04 and 3.16 respectively), so I'm not sure you can use that argument here. Instead of inductive effects, let's consider the resonance structures of our molecules:

$\hspace{5.6cm}$

A positive charge on a nitrogen is always more favorable than a positive charge on a chlorine. From this we know nitrogen is donating its electrons into the ring to a much greater extent than chlorine. Because the electron density is much greater on the heterocyclic nitrogen in B, it will therefore be the more basic of the two.