Answer:
he given sentence is in the active voice, as the subject 'The people' performs an action 'elected' against the object 'him'.
If this sentence is changed to passive voice, then the subject is also changed, in order to retain the meaning of the sentence.
So, the object takes the place of the subject and vice versa and the word 'by' is introduced as now the subject receives the action by the object. The verb form of the sentence is also changed from active form to passive.
'Subject (The people) + verb (elected) + direct object (him) + object complement (Mayor)' changes to:
'New subject (He) + verb (was elected) + object complement (Mayor) + by + new object (the people)'
The passive form of 'made' in the simple past tense is 'was/were made'.
This can be seen in option B, hence it's the right answer.
('He' is the subject form of the object pronoun 'him'.)
Option A: The word 'him' is an object pronoun and hence needs to be replaced with its subjective counterpart 'he'.
Option C: In this option, the subject 'he' is missing, 'Mayor' is an object complement and cannot function as a subject here. Also, 'is' is in the present tense whereas the sentence is in the past tense 'was elected'.
Option D: The verb 'is' expresses present tense and the object complement, which is to define the old object 'him' cannot follow the new object 'the people'. It does not form a complete meaning.
Hence options A, C and D are incorrect.