Japan remained on track for a place in the Rugby World Cup quarter-finals with an impressive 38-19 win against Samoa.