The mesh object should not move after parenting and weighting it to an armature. Since you already keyframed the position of the leg mesh, an armature modifier will break regardless. You should remove the keyframes from the mesh object and place them on the armature object instead.
Update: Here is the edited model:
Here are the steps I followed with GIFs:
- Copy the keyframes from the right leg mesh object to the armature object.
- Since the keyframes were created for the right leg in the body space, we need to replicate the parenting for the armature object to give the transferred keyframes the same context.
- The armature bones don't start from the armature origin. For the best results, we should cancel out this displacement. I copy, paste, and negate each location component into the Move operator fields to achieve this.
- There is another issue. The armature bones were created in a different orientation than the one in the keyframes. I correct this by rotating the bones in Edit Mode.
- The results so far are shown below. Notice how the armature object is moving just like the right leg mesh now.
- Since we successfully replicated the movement on the armature object, we can safely delete the keyframes of the right leg mesh object.
- Now, we can parent the right leg mesh to the armature with automatic weights.
- The last step is to add the bending keyframes using the armature's Pose Mode.
Please note that all of these steps were only necessary to salvage the work we have. The current setup is still not ideal. The right approach is to parent the whole character to an armature with bones for everything (body, neck, head, arms, legs, eyes, ...), and animate solely in the armature's Pose Mode. I recommend against learning these steps if you're still starting out. You should learn the correct process and leave workarounds for a more advanced stage.