"In the dark" and "in the darkness" have the same meaning in these sentences. "Darkness" is more formal.
The only problem with "in the dark" is that it has another meaning. It can also mean completely ignorant about something, having no knowledge at all of it.
I hope my explanation doesn't leave you in the dark!