Hello,
We can approach an answer to this question by doing the resonance forms of both compounds,,, and we can then conclude that the lone pair found in pyrrole ( 5-membered ring ) is involved in the five resonance forms while on the other hand the lone pair found in the pyridine ( 6-membered ring ) is NOT involved in the two resonance forms and this leads to form a concentrated charge in case of pyridine.
SO,,, pyrrole has the lone pair totally involved in the resonance and this means that there is not concentrated charge on the (N) which makes pyrrole a weaker bas than the Pyridine.
Hope The Answer Was brief and Helpful
ALKASED