there will almost certainly be a generator on board, so go and get it. If there isn't, you can cannibalise motors into makeshift generators using magnets and coiled copper wire.
Generating electricity isn't hard in itself, but getting and maintaining the correct voltage and current for the device you are transmitting on will be hard without either not powering it enough or blowing the circuit.
Solar Panels
The electricity went out due to?
Ran out of fuel?
Fuel blockage to generator?
Mechanical failure of generator drive?
The answer to your question depends on too many factors.
How old are the other passengers?
Are there any who are practically minded, not bean counters?
How much damage was incurred to the engine room when ship went aground?
You haven't really thought this question out have you?
I would make as many batteries as I wanted, using:
a) half a cocount shell
b) salt water from the sea, poured into the shell
c) two different metals from passenger's jewelry / boat scraps, inserted into the sea water. Just make sure the two pieces in one coconut don't touch each other.
Connect multiple batteries in series to boost voltage. (metal from one coconut, touches one metal from another coconut)
Connect multiple batteries in parallel to boost current. (gold in coconut A touches gold in coconut B. Silver in coconut A touches silver in coconut B.
With enough coconuts arranged in a series/parallel grid, it may be possible to create up to 1 W to power a VHF marine radio.
Alternately, citrus fruit may be substituted for coconuts and salt water.
You don't unless you have prepared and have hand cranked or gasoline driven generators that are matched to emergency equipment needs.or have people who can get ship equipment working even if the propulsion power can't be brought up.
Do you have magnets and metal? You could create some induction with those two. It wouldn't be much I don't think but would be something.
You and 100 people are on a boat the electricity goes out and you land on a stranded island with no way of communication, how do you generate electricity or get the radio working?