Scotland's hopes of retaining their WXV2 title are boosted by a hard-fought 19-13 win over Japan in Cape Town.