Solution with k=26. Thanks Florian F and xnor for valuable input and an insight derived from retudin's answer.
I'll first introduce a basic version of the strategy lets us solve the problem with k=30, and is much more plausible that the prisoners would be able to execute it. Each prisoner will convert the numbers they see in the boxes to ternary, and communicate the digits one at a time to each other. Only 10 prisoners of the 100 are needed for this strategy.
If zero is on the board, the prisoner looks in box A and writes down 1 + the value of the first digit of the ternary representation of the number he sees.
From there, Let the current board number be x. A prisoner entering the room extracts two pieces of info from it. The ternary digit of interest is the $\lceil x/3\rceil$th, and the value of that digit that is being communicated is x-1 mod 3. If the digit is odd, the prisoner looks in box B; if it's even, he looks in box A. He compares the digit he sees with that communicated. If they differ, he states which box has the larger number, otherwise he passes along the value of the next digit of the number he saw to the next prisoner by writing down $1 + (3*digit) + value$
In the worst case scenario, the tenth prisoner writes a 30, and then the next prisoner will certainly know which box is larger. But we observe that there's no reason to write 30, since that prisoner will know that his box is larger. The same is true for 28, it must be smaller than the other box, which would let us get away with only k=28 for this basic strategy.
But in fact, at every step of the process, if a prisoner sees the lowest or highest possible value within the set of current possibilities, he can immediately answer the question and end the game. We use this insight to get a slightly smaller k of 26.
There is no longer a clean way to define the groups (in the first strategy, each group was a ternary digit dividing the numbers into 3 group), but we'll assume these prisoners are brilliant mathematicians and can figure out the exact group boundaries. At each step, including the first, the prisoners will first check if the number in the box they look in is the highest or lowest possible of the range, then they divide the remaining numbers into groups of size depending on what digit they are on. The optimal group divisions are [3, 3, 3, 3, 3, 3, 3, 2, 2, 1]. The 1 seems funny, but really it just communicates that another round of trimming the top and bottom is all that's needed.
As a brief example of the basic strategy:
Suppose the number are 49,000 in box A and 44,444 in box B. In ternary, these are 2111012211 and 2020222002 respectively.
The first prisoner goes in, he sees 0, which means he checks box A and considers only the first digit of its ternary representation, which is 2. He writes 3 on the board, which is the 1 + the digit.
The next prisoner see 3 on the board. This isn't 0, so he computes $\lceil3/3\rceil = 1$ and 3-1 mod 3 = 2. The digit, 1, is odd so he's looking in box B. He checks the first digit against the value 2, and sees they are equal. Now, for the next prisoner, he communicates that the 2nd digit of the number he sees is 0 by writing $1 + (3*digit) + value = 1 + (3*1) + 0 = 4$
The next prisoner sees 4. This isn't 0, so he computes $\lceil4/3\rceil = 2$ and 4-1 mod 3 = 0. The digit, 2, is even so he's looking in box A. He sees that the 2nd digit is 1. This is greater than the 0 that was communication, so he correctly announces that Box A has the bigger number.
For the "advanced" strategy:
The first prisoner sees a 0 and looks in box A. If it contains 1 or 50,000, he gives the answer. He divides the remaining 49,998 numbers into 3 groups: 2 to 16667, 16668 to 33333, and 33334 to 49998, and communicates which group with the number 1, 2, or 3 [He'll write 3 for the 49,000v44,444 case above].
The next prisoner sees that number and looks in box B. He notes that 44,444 is in group three, so the game goes on. He removes the highest and lowest from the range to get 33335 to 49997, and divides that into 3 groups as best he can: 33335 to 38888, 38889 to 44442, and 44443 to 49997. These don't divide perfectly evenly, but our brilliant prisoners have a consistent scheme worked out. They also have memorized a massive lookup table for figuring out the current group range. In any case, he writes down 6 since we're in the second digit, third group.
Back to box A for prisoner #3, also in group 3, so we get a 9 for prisoner #4 who sees that the number in box B, is in a lower group and so the game ends. If the numbers were closer, we might have gone to the 8th prisoner, at which point we'd begin dividing into 2 groups rather than three. If it makes it to the penultimate prisoner, he'll have 4 numbers in the range. He'll just write 26 if it's in one of the middle 2 numbers, and the final prisoner will have a range of 2 and know which is bigger once he looks in.