An IPv4 address is a 32-bit number, and it doesn't matter if the mask is different, all 32 bits are the address, so if they are the same then it is the same address.
The mask (or mask length) simply determines which portion of the address represents the network, and which portion represents the host on the network. The
/24 network address is a subnet of the
/22 network. That means the
/24 network is part of the
/22 network, but the
/22 network also has other addresses not part of the
/24 network. The single address is part of the
/24 network, and by extension, part of the
/22 network that contains the
/24 network. The address is the same address, regardless of the network mask (or mask length).
The IPv4 packet headers do not contain any mask information; they only have the address, so there is no way to determine from the packet, which network you mean, so yes, you have two hosts with the same address.
Think of your networks/subnets as a binary tree. Adding a bit the the mask length simply halves the number of host addresses for the network. In the diagram below, it doesn't matter where you start on the binary tree above the host address (
/24, etc.), following down the binary tree will get you to the same final address:
The mask length just tells you where in the binary tree to start.