Why does the Pasuk not say simply that Yosef asked 'them'? Why does it see fit to add that they were Serisei Pharaoh, and that they were with him in the jail that was in his master's house?
Ramban: It is in praise of Yosef, who in spite of his young age and status of slave, he relied on his wisdom to relieve them of their distress, undeterred by the fact that he was in the domain of a master who hated him 1 and who could have executed him at a whim. 2
Seforno: It is only because his master placed them under his jurisdiction 3 that he dared ask them about their thoughts; otherwise it would have been presumptuous for him to do so.
Ohr ha'Chayim #1: Normally, it is improper to ask great people about their thoughts. Since they were together, he was concerned lest they are displeased with him. Ha'Emek Davar - perhaps his master will blame him for their discontent; perhaps he did not serve them well enough.
Ohr ha'Chayim #2, Ha'Emek Davar: Since they were all together, they are all inmates, and he was not concerned for their importance. Malbim - the noble and the slave, when they are strangers in another land, or captives, they love each other like equals.
Ohr ha'Chayim #3: Perhaps their displeasure pertains to Yosef's master. A faithful servant must investigate matters relevant to his master.
Why did he say "ha'Yom"?
Ohr ha'Chayim, Malbim: It cannot be that you are sad due to being in prison, for if so, also the previous days you should have been sad!