We investigate the thermal instability in an electron-ion magnetized plasma relevant to galaxy clusters, solar corona and other two-component astrophysical objects. We apply the multicomponent plasma approach when the dynamics of all the species are considered separately through electric field perturbations. General expressions for perturbations obtained in this paper can be applied to a wide range of multicomponent astrophysical and laboratory plasmas also containing the neutrals, dust grains and other species. We assume that background temperatures of electrons and ions are different and include the energy exchange in thermal equations. We take into account the dependence of the collision frequency on density and temperature perturbations. The cooling-heating functions are taken as different ones for electrons and ions. As a specific case, we consider a condensation mode of the thermal instability of long-wavelength perturbations when the dynamical time is smaller than a time during which the particles cover the wavelength along the magnetic field due to the thermal velocity. We derive a general dispersion relation taking into account the effects mentioned above and obtain simple expressions for growth rates in limiting cases. Perturbations are shown to have an electromagnetic nature. We find that at conditions under consideration transverse scale sizes of unstable perturbations can have a wide spectrum relatively to longitudinal scale sizes and, in particular, form very thin filaments. The results obtained can be useful for the interpretation of observations of dense cold regions in astrophysical objects.