The lone pair of electrons of the side chain nitrogen in tryptophan is part of aromatic conjugation which is why it is not available for protonation while the lone pair of one of the nitrogen of histidine side chain is available for protonation making it more basic.