Update Edge Info when using script in Edit Mode
I'm trying to guess why you need to stay in edit mode. If it isn't critical you can add,

bpy.ops.object.editmode_toggle()
bpy.ops.object.editmode_toggle()


(both lines) before the call to update. This is essentially doing in code what you do manually in the gif - flipping from object back to edit mode to update the display of length values.

Updating the 3d view is also covered in this answer here