All of your sentences are correct. The choice of where to position the "maybe" is one of style rather than grammatical necessity.
If style is what you'd like to improve on, I would suggest getting rid of the "was...maybe" structure altogether:
He saw something that may have been a ghost.
...