At times, “Melancholia” comes perilously close to being a kitschy serio-comic melodrama about the end of the world. At others, it evokes the spiritual and lyrical sensibility of the great Russian director Andrei Tarkovsky (specifically his last, stunning 1986 feature, “The Sacrifice”), to whom “Melancholia” is dedicated.