Two methods I know: Copy Global Transform addon, and Constraints.
Copy Global Transform
(doesn't seem to work in your case, but could in others)
If the armatures have the same bone names and dimensions, you could try using the Copy Global Transform addon.
It is shipped with Blender, you just need to enable it via the menu Edit > Preferences > Addons tab

The addon's UI will be located in the viewport > Sidebar > Animation tab > Global Transform panel

Then, select both rigs in object mode, ↹ Tab into pose mode, and select all the bones of one rig. Copy the pose. Then select the other rig's bones and paste using the addon's panel. Hopefully it pastes the pose correctly, and you can repeat for each frame.
Constraints
In the armature you want to copy the animation in, you could select each bone one by one in pose mode and add a Copy Transform constraint targeting the source armature's same bone.
Then, you can use Pose > Animation > Bake Action with visual keying and clear constraints ON:

Adding constraints to each bone can be time-consuming, so here's a script that does it for you.
Select the armature you want to copy the animation to, and ↹ Tab into Pose Mode. You just have to paste the following script in the Script editor, make sure to write the name of the armature you want to copy from in the ARMATURE_SOURCE
variable lines 4 between the simple quotes at the end. Here I used 'Armature'.
Then run the script with ⎇ AltP.
import bpy
# Get references to the 'Armature' and 'TPose' armatures
ARMATURE_SOURCE = bpy.data.objects['Armature']
ARMATURE_TARGET = bpy.context.active_object
# Initialize a count for bones with no equivalents
no_equivalent_count = 0
# Loop through all bones in 'ARMATURE_TARGET' armature
for bone in ARMATURE_TARGET.pose.bones:
# Check if there's a bone with the same name in 'ARMATURE_SOURCE'
if bone.name in ARMATURE_SOURCE.pose.bones:
# Remove all constraints from the bone to avoid redundance and potential issues:
for constraint in bone.constraints:
bone.constraints.remove(constraint)
# Create a Copy Transforms constraint and set the target bone
constraint = bone.constraints.new(type='COPY_TRANSFORMS')
constraint.target = ARMATURE_SOURCE
constraint.subtarget = bone.name # Use the same bone name as the target
print(f"Constrained '{bone.name}' to its equivalent in '{ARMATURE_SOURCE.name}'.")
else:
# If no equivalent bone is found, print a message and increment the count
print(f"No equivalent bone found for '{bone.name}' in '{ARMATURE_SOURCE.name}'.")
no_equivalent_count += 1
# Print the count of bones with no equivalents
if no_equivalent_count <= 1:
print(f"Number of bones with no equivalents: {no_equivalent_count}")