Japanese railway firm apologises after train leaves 20 seconds early