Your reasoning contains an important and common misconception. The relative basicity of two compounds does not necessarily correlate with their relative acidity. For example, CH4 is both an extremely weak acid and an extremely weak base.
When they ask about relative acidity, you should consider the stability of the acid form compared to the conjugate base form. In other words, think about the ability of the molecules to lose a proton.
When they ask you about relative basicity, you should consider the stability of the base form compared to the conjugate acid form. In other words, think about the ability of the molecules to gain a proton.
In this question, molecule 3 (imidazole) happens to be both the most acidic AND the most basic. It has a relatively stable conjugate acid, and also a relatively stable conjugate base. These things happen sometimes.