2017 xf 2.0 diesel no start sometimes

Has started but only idles and for about 2 or 3 minutes Has previously had hydrolocked slightly and after no start for days it starts for a moment.
recent def service by dealer. Had a message to service or complete shutdown !!
new battery recent after service issue started then def service was done then got worse. 43k on vehicle. Scan includes p25a9-13 p023a-13 p0597-13 p0a14-13 p0263-92 p0268-92 p006a-84 p0a0f-97 u0028-63 p2251-13

That’s a lot to get straightened out! Way too much going on for me to give an off the cuff diagnosis. Its probably best to get it to a good mechanic and have them eliminate possibilities one by one. Good luck.