The grammatical role comes from the sentence, even when the word does not display a changing case ending.
Consider وَعَدَ اللَّهُ الَّذِينَ — “Allah promised those who ...”
- اللَّهُ is the explicit fa'il.
- الَّذِينَ receives the action of promising, so it is the maf'ul bihi.
- الَّذِينَ is mabni; therefore we describe it as being in the position of nasb rather than looking for a new visible ending.
The displayed excerpt stops at الَّذِينَ; the ellipsis shows that its relative clause is not quoted here.