Yes, they are both correct. However, they mean different things.
“He chose…” implies a decision was made and action taken.
“He prefers…” implies the situation is yet to be resolved.
Do note that you can drop “being with” from the sentence and it will flow more naturally when speaking with native speakers. Ie “He chose to be with her instead of me.” This is a complete and accurate sentence in English.