As a general rule electric motors excel at high speed low loads while hydraulics work best at the low speed high torque end. Especially where the range of motion is small, the forces large and precise control is required there is a lot of knowledge and existing design around hydraulics. In particular with the grid fins there is the need to make rapid precise changes to the position.
For hydraulics the moving assembly can be compact,simple,light weight and low inertia. It will also consume very little power when not moving, and hold position well while also allowing precise small movements limited largely by the point at which surface tension prevents making the flow through the valve more constricted.
For electric drive there will need to be a gearbox which adds space and weight and a lot of backlash. So while high speeds are achievable rapid small reversing moves requires driving the motor quickly to take up the backlash and then a bit more to get the required motion. The backlash also means that if the force on the load changes direction there can be motion of the load (grid fin) as the backlash 'swaps ends' even with the motor locked. These two factors make the control process much more complicated. Driving in and out of a stalled condition at low speed can also be complex for an electric drive due to the large number of friction points in the motor and gear train to be unstuck without producing excessive motion.
So yes it can/has done, but would bring new problems. If using electric motors for flight control it might actually be better to redesign the control scheme to use a larger number of smaller control surfaces that better match the nature of electric drive.