Take the one way journey time, add the minimum time it needs to spend at the terminus. Then double the answer to get the time from departing A to travel to B and back and be ready to depart from A again. Then divide the new answer by the interval between successive services. Rounding up to the next integer gives the number of trains needed in service.
So for example, journey time 40min, time at terminus 10min, total 50m, double to 100min. If you want a train every 30min then the answer is 3.3333 which rounds up to 4 trains in service.
A rule of thumb is to have 10% for trains not in service then round up again, which would give 5 trains for a microfleet to run this one service. It would normally be done for a larger fleet running several services.