The wires attached to the smoke detector are (almost certainly) short, maybe 6", pigtails, and are joined to the RV wiring in the wall or ceiling. You should be able to pull them enough to access the joints and detach there. In my RV they used wire nuts, taped to prevent them from working loose, for all those sorts of connections; but there are a few possible methods that could be done. (I know some will say that wire nuts are no good for RVs, but so far all the wire nut connections in mine have been trouble-free.)
As BB alludes to, make sure you insulate the loose wires somehow or another so they can't short out.