Don’t see why not, hydraulic brakes started on mountain bikes after all, and hydraulics aren’t fussy about “pull” length as the pad movement is small and the fluid incompressible. I’d be more worried about the geometry, as that of flat barred bikes and those with drops differs considerably IIRC. And what about the gear shifting? I don’t know if shift ratios are the same betwixt drop bar levers and flat bar levers - but I’d hazard not, this being Shimano.