The correct answer is: D. Was

The verb "to be" is irregular, and its past tense form is "was". In this sentence, the verb "to be" is used as a linking verb, which means that it links the subject of the sentence (Janak) to its predicate (the king of the city of Mithila). The simple past tense is used to describe events that happened in the past, and in this case, the event is that Janak was the king of Mithila.

The other options are incorrect because they are not the past tense form of the verb "to be". Option A, "is being", is the present progressive tense, which is used to describe events that are happening now. Option B, "has been", is the present perfect tense, which is used to describe events that started in the past and continue to the present. Option C, "had been", is the past perfect tense, which is used to describe events that happened before another event in the past.

In conclusion, the correct answer is D. Was.