Feed each phase into a separate transformer then play with low voltages (AC or unsmoothed DC).
If you don't isolate then you have to design for phase-phase voltages and faults.
If you want to see how it's done with a single phase (along with AC power failure detection) elsewhere have a look at the circuit diagrams for an APC UPS
for example:
https://elektrotanya.com/apc_ups_450_620_700.pdf/download.htmlOn sheet 1 they have a centre tapped transformer feeding two diodes. The full wave rectified signal gets sent to sheet 2 ("IN-RECT"), On sheet 1 it gets used to create an AC-OK signal.
A further blocking diode then feeds the smoothing capacitors and provides VSTBY to the rest of the device. (the blocking diode prevents the AC-FAIL and AC Input voltage detection from seeing the smoothing capacitor.
On sheet 2 IN-RECT gets conditioned with two resistors and a capacitor before being fed into an ADC (IC10).
Put another way - with a transformer you can get away with two diodes, two resistors and a capacitor, and a known safe circuit which can give you DC power for free on the side. (Hint feed the smoothed DC output from both transformers via diodes into a regulator and you get safe "redundant" DC power from either phase)
Yes the transformers take up real estate, and aren't cheap, but you are trading the known cost of component and PCB space against the costs of designing a solution which can handle unknown failure modes in the face of 400VAC.
Also if needs be, you can carry out conditioning of the signal "cheaply" in the analogue domain rather than having to code a solution from scratch.
jk
PS If you never intended connecting directly to the AC supply, you should have made this clear by showing the two AC sources as being each fed via a transformer... (My crystal ball hasn't worked for years...)