The lights went out and we were left in the dark.

Literal

Light [subject-が] extinguish [and] we [topic-は] darkness [possessive-の] inside [in-に] were-left-behind.

消えて is the te-form of 消える, linking the two clauses as sequential. 取り残される is the passive of 取り残す ('to leave behind'), giving 'to be left behind.' の中に again for 'inside (an enclosed space/state).' A dramatic narrative construction for blackouts or similar events.