A magnitude 5.7 earthquake struck western Shizuoka before dawn on Sunday, injuring more than 20 people and disrupting trains across central Japan.