Houston was already severely damaged from a previous battle. Japanese material and numerical superiority in the area was obvious. This was a desperate attack in hope of interrupting the Japanese offensive. I think every man on board understood it was effectively a suicide mission.
My dad's ship the Marblehead was fighting for it's survival after that battle.
I don’t think they were making an attack as such the Houston and the Perth, along with a Dutch destroyer were all that remained of the Allied navy and they were making a run around the west Java coast down through the Sunda Strait (site of the Krakatoa volcano) from Batavia (Jakarta) to Australia.
They simply had the misfortune to run slap bang into the main Japanese invading force which annihilated them.