Unless I am missed some configuration, it seems that the transitivity reasoning rule is broken on Stardog 5.0-RC but when I try it on Stardog-4.2.3 it works fine.
Are you executing this query through the web console? Can you try executing this query on the command line using stardog query execute -r? The -r switch enables reasoning.
We have seen (and continue to look into) some bugs with the web console regarding the enabling of reasoning. It will be taken care of for the next RC/release.