Semiconductor nanowires are a promising candidate for next-generation solar cells. However, the optical response of nanowires is, due to diffraction effects, complicated to optimize. Here, we optimize through optical modeling the absorption in a dual-junction nanowire-array solar cell in terms of the Shockley-Quessier detailed balance efficiency limit. We identify efficiency maxima that originate from resonant absorption of photons through the HE11 and the HE12 waveguide modes in the top cell. An efficiency limit above 40% is reached in the band gap optimized Al0.10Ga0.90As/In0.34Ga0.66 As system when we allow for different diameter for the top and the bottom nanowire subcell. However, for experiments, equal diameter for the top and the bottom cell might be easier to realize. In this case, we find in our modeling a modest 1-2% drop in the efficiency limit. In the Ga0.51In0.49 P/InP system, an efficiency limit of = 37.3% could be reached. These efficiencies, which include reflection losses and sub-optimal absorption, are well above the 31.0% limit of a perfectly-absorbing, idealized single-junction bulk cell, and close to the 42.0% limit of the idealized dual-junction bulk cell. Our results offer guidance in the choice of materials and dimensions for nanowires with potential for high efficiency tandem solar cells.