Where several persons are made defendants to any action, and any one or more of them shall have judgment in his favor, every person so having judgment shall recover his costs, in like manner as if such judgment had been entered in favor of all the defendants, unless it shall appear to the court that there was reasonable cause for making such person defendant to such action.
§ 514.100, RSMo