How to update an object after changing its uv coordinates?
This is a simple fix - all you need to do is run the update() function on the object's mesh data: obj.data.update()

Depending on your intended use case, you may also need to run bpy.context.view_layer.depsgraph.update() to update the dependency graph.