Assuming these are home-brewed RPMs, rewrite your `spec` files to install the executables under a versioned name, say `test-1.2` and `test-2.1`, and use the `update-alternatives(8)` system to configure one of them for system-wide usage.
This is the policy followed by RHEL for the `java` executables, for example.