For what it's worth, I have a near-identical requirement: flac for listening on my desktop, ogg files sync'd to my phone.

When I ripped all the CDs in the first place I placed the flac files in subfolders <albumname>/flac . Then in foobar2000 I just prepend 'flac' to any search query.

It's not ideal, but having read the docs I don't think there's a way to specify the 'prefer flac and remove duplicates' behaviour.