The carapace shows the distinctive lines of _Chiromantes dehaani_ ( _Kurobenkei-gani_ in Japanese). This species can be found quite far away from the ocean, commonly in brackish streams and rivers. The size fits your description, the width of the carapace is approximately 3-4 cm, giving the entire body roughly the same size as you observed. These crabs are also most active at night.
I have seen these crabs in sheltered areas slightly inland from the sea. Here is a photo of _C. dehaani_ that I took in Tokyo: , your photo does not show the distinctive red claws and this species is less common in Tokyo Bay due to development and loss of its natural environment of mudflats. Therefore, I think it is save to identify this as _C. dehanni._