Because of the different NETMASK, I'm wondering if I put the two servers in the same Switch, will this be ok?
No.[*]
The netmask is only used for routing a packet - decide whether the destination is local or which gateway to use. The netmask is not used for addressing, so two nodes using the same IP address on the same L2 segment/switch/VLAN always conflict.
As already outlined, workarounds involving NAT, ARP filtering, static ARP, port forward filtering (private VLAN) or such are possible but usually very much to be avoided.
[*] Two servers on the same switch doesn't explicitly exclude using multiple VLANs where duplicate IP addresses are certainly possible (yet impractical).