It is a long time since this query was first posted but I hope that the following may close off the query and reach the other members who made comments above.
I am a postal historian and have collected and studied mail (envelopes and cards) written in or addressed to hospital ships for the past 40 years.
During the First and Second World Wars hospital ships operated by government bodies (navy & army for instance) were usually (but not always) painted overall white with a horizontal band around the hull painted green. Most had, in addition, large red crosses on the hull (depending on the size of the ship there might be one, two or three red crosses on port and starboard but sometimes none at all). Most funnels were plainly painted but some had red crosses. All these varieties appear to be each government's interpretation of the several Geneva Conventions. Privately operated hospital ships (i.e. those operated by Red Cross organisations or similar) would have a red horizontal band around the hull - a variant often challenged by warships etc.
During the Second World War a number of ships were chartered by the International Red Cross to carry out voyages of refugee or prisoner exchange, or famine relief. These vessels were painted in a variety of colour schemes, seemingly outside of the internationally accepted 'hospital ship' colour scheme.
The ships shown in the two photographs mentioned above were of the latter category and had been chartered by the IRC for several refugee exchanges or repatriations. Both were Italian owned ships but by the time the photos were taken (28 August 1944) both had been returned to their owners, having completed their respective charters. Both ships had red crosses painted on their hulls, together with the Italian flag, and white overall. Their funnels were painted with a Swiss cross, i.e. a white cross on a red circular background.
Both ships had been laid up in the harbour of Vallone di Zaule, near Trieste. When Italy collapsed in September 1943 both were scuttled where they were moored. Later they were raised by the Germans but before they could be restored the South African Air Force attacked and sank them. The ship shown on its side was the Duilio and she was sunk on 6 July 1944. The one shown as being fired upon (and subsequently sunk) was the Giulio Cesare.
Both vessels were empty of personnel at the time of their sinking and the attacks were legitimate and legal. Perhaps it had been decided that to leave the mercy ship markings on the hull and funnels would afford better protection for the two ships; another reason might have been that it had been thought they might be used again for similar repatriation duties.
Apologies for the length of this post but I thought it essential to state the facts rather than allow speculation to remain.