Fuel Cell chargers usually need longer to charge a phone as they have to produce the energy on the fly, but with enough fuel you have almost endless recharges available.
Power banks are a one-time solution as they will have to be recharged after use, but supply their reserves faster.
One possible way is to look for free sockets on A.C compartments compromising with individuals or looking for empty tier.The other individual may not know whether this is your berth or not in the tier.
Possible security concerns are there but with partner it is safe.
As Dawnkeeper suggest your safest bet is to use use a power bank or portable fuel charger, but if you want to use the electricity already on the train you your best bet is to locate one which could be slightly hidden and utilise this one. I.e. maybe there is lights in your compartment attached to a socket, or a socket in the bath room (if you have one), underneath the seat, behind a panel (slightly more illegal perhaps).
If no hidden sockets are to be found, or if all are occupied, you could bring your own multi-outlet/power strip/extension cord and disconnect the previous appliance and then reconnect that and your charger in addition. This could even provide another socket (or two) for other in same predicament.
Touching illegal you could argue that you have the option to disconnect switches or lamp bulbs and connect two wires to these and use that as a makeshift socket, but I would strongly advise against any such hacks as you are aboard a moving train which shifts around which adds to the danger of tampering with live electricity and increases the risks of short circuiting and hurting your self and others.
I am afraid that there are no way to charge your phone fast enough without using of built-in AC sockets if they are present in train.
Passenger trains may have an AC socket for electric razors, at toilet. If you are lucky man and your train has AC socket and if your phone supports fast(quick) charge, you will have enough time to increase your battery level for 10-20% from 0, while you are in toilet, until next man who wants the toilet will start knocking. You also may use AC splitter and charge simultaneously your phone and your power bank.
Another way is to try to use the USB hand crank dynamo charger (very cheap, easy to buy), but it produces too small power and too big noise for regular using.
As an alternative to a power bank: you can get power banks and chargers that contain a solar panel. Place the solar panel against a window (preferably a sunlit window).