الْمُسْلِمِينَ can be either accusative or genitive without changing its written form:
رَأَيْتُ الْمُسْلِمِينَ.
Translation: I saw the Muslims. It is a direct object, hence accusative.
مَرَرْتُ بِالْمُسْلِمِينَ.
Translation: I passed by the Muslims. The preposition requires genitive.
Remember: Look at the verb and preposition, not only the final letters.