In bi-ghalasin, the preposition indicates the circumstance of the prayer; ghalas is the lingering darkness of dawn. It concerns time and light conditions, not rakʿahs or recitation length.
In ṣallā al-imāmu bi-al-nāsi al-fajra, the imam is the subject; the clause identifies the led prayer and its timing.