“Two-headed” serpent is a two-faced liar
The two-faced lying serpent in question is a sea snake called a yellow-lipped sea-krait (Laticauda colubrine, in science lingo). LiveScience writes:
Arne Redsted Rasmussen of the Royal Danish Academy of Fine Arts, School of Conservation in Copenhagen discovered the phenomenon while diving off the coast of the Bunaken Island in Indonesia. There, he watched as a yellow-lipped sea krait probed the crevices of corals. From his perspective, the snake seemed to be foraging with its tail, since its “head” was facing the scientist.
Shortly thereafter, the diving scientist watched as the snake pulled “another head” out of the crevice. He noted that each time the snake poked its snout into a coral opening, its tail twisted around the length of the snake’s body and began to move about (like any head would) to, apparently, monitor the scene and keep a lookout for danger.
When the snake swam away, this perceived head showed itself as the snake’s flattened paddle-like tail.
Head and tail also has similar colors and markings, further adding to the illusion. The purpose of this trickery seems to be to fool predators. While the snake pack some potent venom, it’s vulnerable when foraging for food with its head – where the venom is, by the way – deep in a crevice. If a predator is fooled to believe the snake is on the lookout for threats, with venomous fangs pointed in their general direction, they might be less inclined to attack.