Two thoughts.
First, for Kant himself, it is never the case that the categorical imperative comes in conflict with itself. In other words, Kant rejects the idea that there are conflicting moral principles and we must choose among them.
Second, the problem you pose does not even demonstrate conflicting moral principles or a situation where the categorical imperative obliges us to take two mutually-exclusive courses of action
. You seem to be misunderstanding the categorical imperative when you equate it with the imperfect duty to help others.
In the situation, you describe the moral self has a choice between two courses of action both of which are possibly moral if performed in accordance with the categorical imperative. The wording in the preceding sentence is obtuse but important -- For Kant, actions do not necessarily qualify as moral even if the end agrees with morality. Instead, they only qualify as moral when the maxim of my action corresponds with a law that could be universalized or that treats humanity (rational nature) as an end rather than a means or as a possible law in a kingdom of ends.
Stated another way, helping either person for the right reason would qualify as moral as a fulfillment of the imperfect duty to help others. BUT it does not follow that you have failed in this duty because you did not help all others at all occasions. (Kant explains this in more detail in the Metaphysics of Morals: Doctrine of Virtue and Critique of Practical Reason).
One major reason for this is that Kant is not concerned primarily with the consequences of our actions. Thus, for Kant, that one person died because I saved someone else does not ever impute a moral wrong to me. In fact, it is possible to act morally in ways that lead to the deaths of others on the Kantian picture. Specifically, because my duty is to pursue a maxim that treats others as ends -- and these others can include those with immoral goals. (Cf. Why shouldn't you lie to the future murderer of your children?)
To answer one formulation of your question towards the end, you ought to save one of the lives because each life is an end of infinite worth rather than price. You need not feel any guilt that saving one meant you couldn't save the other.
I have an obligation to keep others from peril and an obligation not to hurt people.
These are two different obligations. The first is not to be found in Kant. The second is absolute but does not relate to your example.