رَأَيْتُ مُسْلِمَاتٍ.
Translation: I saw Muslim women.
مَرَرْتُ بِمُسْلِمَاتٍ.
Translation: I passed by Muslim women.
In the first sentence, مُسْلِمَاتٍ is an accusative object; in the second it is a genitive noun following a preposition.
The case sign is the same, but the case is different. Never infer grammatical function from the ending alone.