I am guessing that a few days of prayer and supplication were involved. It seems that they found two worthy candidates and could not decide between them. Looks to me that they did say to the Lord, "thy will be done" by casting lots.
What you have here is a representation of a living church. The eleven did not dispute that they needed another to join the Quorum of Apostles, instead it was a question of which one would be ordained by them to the calling of special witness of the ressurection.