During the late 19th and early 20th centuries , Japan became a regional power that was able to defeat the forces of both China and Russia .