You want to use the higer duration because that can expose the price change more quickly. Movement in price can cancel out the yield advantage of the higher-yield bond given the movement in interest rate.
higher yield bond - likely is going to be the lower priced of the two bonds too. So you would be buying up the lower priced bond - thus costing you less as well.
But note that this question could very possibly be asked as what should you do with a particular BOND as well. In that case - that bond’s duration only should be used.
Another common twist - they give you annual rates - ask you to calculate the amount of bond required for a quarterly increase in yield (quarterly change in spread)…
look at the book for examples … read in the white material between blue boxes. there are examples there - and if I recall right - there was at least one example in the EOCs.