Yes. These sentences have the same meaning. In this case, sentence A is not the best placement for the prepositional phrase because it interrupts the action between the the subject verb and object. "After midnight" is a time stamp that would be better put at the beginning or the end. (See example C.)
A: The rain changed after midnight into snow. (possible. nice poetic or musical use)
B: After midnight, the rain changed into snow. (the emphasis is on the time it happened)
C: The rain changed into snow after midnight. (common position)