Did the witch really take the baby? Or was it imagined by the parents of the baby?
Yes, in the context of the film's world, the Puritans' idea of witches--and by extension, black magic and the devil--are "real." This is the central twist of The Witch, and why I found it so clever.
Throughout most of the film, undeniably supernatural events happen offscreen, in flashback, and/or witnessed only by a character in severe duress--e.g. the baby sacrifice, or the older brother's encounter with a witch after becoming lost in the woods. Outside of these episodes, we're drawn into the drama of a 17th Century New England Puritan family that's flawed, tight-knit and relatably human, descending into dire straights as their farm slowly fails and they deal with grief.
By playing on our expectations as a modern audience, the film leads us to believe that we're watching a story set in the historical world, detailing a family's fraying psychological state, when we're actually watching a film set in the 17th Century world as the Puritans believed it to be: the devil is an active and powerful participant in human affairs, witches haunt the dark forests, and God turns a blind eye on those who've committed any sin.
As far as I can tell it was real because the disappearance was initially perceived by Tommasin rather than the parents and no evidence is given by anyone to suggest the baby was still around.