"The crew did not sufficiently check the departure time and performed the departure operation."
They assured customers that staff had been given additional training to ensure it doesn't happen again.
The company added that no one missed the train as a result of the early departure and confirmed no complaints had been made about the incident.
Punctuality is a big deal for trains in Japan, as workers rely heavily on public transport. Many train companies boast that their average delay time is under one minute.
Commuters have been joking about the apology on social media, with many recalling their own experiences on late-running public transport.
"Tokyo train company's apology for 20-second-early departure is one of the best things about Japan," tweeted one.
Another wrote: "I once had an Israeli bus driver laugh at me after he closed the door on my hips and drove off with my legs hanging out of the bus. I am so envious of Japan right now."
A UK commuter posted: "They apologise for being 20 seconds early, and yet you don't get an apology from any major UK train company until they're over 2 hours late.
Schuyler Velasco wrote: "I took a commuter train in Tokyo that was 2 minutes late, and there were profuse apologies. It was 2 minutes late because there was an earthquake."