You are correct that the plaintiff must be brought by a real party in interest.
There are a couple of possible scenarios for handing this. One is called a plaintiff in intervention, under California Code of Civil Procedure Section 387. I think this is probably what needs to happen in your case.
The other is that the real party in interest defendant is really an indispensable party. The definition of an indispensable party is “A person who is subject to service of process . . . shall be joined as a party in the action if . . . he claims an interest relating to the subject of the action . . . .” (Code Civ. Proc., § 389, subd. (a).)
Frank W. Chen has been licensed to practice law in California since 1988. The information presented here is general in nature and is not intended, nor should be construed, as legal advice for a particular case. This Avvo.com posting does not create any attorney-client relationship with the author. For specific advice about your particular situation, please consult with your own attorney.
Was the "real party in interest" served with the lawsuit? If so, out of abundance of caution, a responsive pleading should be filed, such as a demurrer, motion to strike, etc. If not served, you can wait to see what pltf does. You could request pltf dismiss with prejudice or file amended complaint deleting RPI, and you could voluntarily file demurrer or motion if he refuses to do so. alk to a local atty.