مَرَرْتُ بِالْمَسَاجِدِ — I passed by the mosques.
بِـ: preposition.
الْمَسَاجِدِ: genitive noun with visible kasra because it has the definite article al-.
A diptote of this pattern takes genitive kasra in this context; the underlying plural pattern does not change.