Flooding in Jakarta and along Java’s north coast has disrupted roads and forced Indonesia’s rail operator to cancel dozens of trains.