Sometimes dreams stay vividly in one's memory.

Literal

Dream [subject-が] vividly memory [at-に] remain [nominalizer-こと] [also-も] exist.

生き生きと is an adverb meaning 'vividly, lively' — literally 'alive-alive' with the adverbial と. 残る ('to remain') for memories and impressions. ~こともある = 'there are cases when X,' 'sometimes X.'