Efficiency has nothing to do with motor or engine sizing, since they are rated by their output (efficiency is the ratio of output power to input power).The current fuel engine is 14hp. What would be a correct size for electric motor (kW)? Would 5kW be enough? I’ve understood the effiency is a lot better with these. But unfortunately I don’t have specs of the hydraulic pump with me here.
For the same performance, you need to match the maximum output of the electric motor to the maximum output of the original engine, and match the continuous output of the electric motor to the continuous output of the original engine. It's unlikely that the original engine was used at 14 horsepower continuously, and it's likely that an electric motor advertised as "5 kW" can actually produce 5 kW continuously for any useful period of time.
Assuming that everything in the machine is driven through the hydraulic system, it would be very helpful to have the hydraulic pump specs. You would certainly have enough motor if you chose one which can run at 10 kW (about 14 hp) continuously, and provided a drive (gear, belt, or chain) as necessary so the motor can run at the speed it needs to produce that power; you can probably get away with one that can intermittently run at 10 kW and continuously run a lower power... 5 kW may be reasonable.