ECMP balancing sometimes breaks TCP connection

But that’s the very point. The Mikrotik feels free to use any of the two gateways, because it cannot even dream about such kind of misuse. Normally, if you send a packet towards destination address A, that address A is on a single machine, and so it doesn’t matter through which network path (beginning with a gateway) you send them as all network path end, sooner on later, in the same point.

In your weird setup, the two servers advertise the same address (subnet), but the two apparently equivalent network paths are not equivalent at all.

ECMP can be only used this way if you don’t mind that you must have routing cache activated (be aware that routing cache is gone in ROS 7 because it is gone from linux kernel for security reasons) and if you don’t mind that it gets flushed now and then, and the next packet after the flush may choose the other gateway.

You can use a dstnat rule combined with a per-connection-classifier or other distribution rule (random) if you want to distribute the traffic from clients to two physical servers visible under the same IP address to their clients, but not ECMP.