Any act of obedience to Gods command is a work, a good work. Believing on Christ is a commandment of God, so therefore a good work 1 Jn 3:23
And this is his commandment, That we should believe on the name of his Son Jesus Christ, and love one another, as he gave us commandment.
Acts 16:31
And they said, Believe on the Lord Jesus Christ, and thou shalt be saved, and thy house.
The word believe here is the greek word pisteuō and in this instance its an imperative which means:
The imperative mood corresponds to the English imperative, and expresses a command to the hearer to perform a certain action by the order and authority of the one commanding. Thus, Jesus' phrase, "Repent ye, and believe the gospel" (Mk.1:15) is not at all an "invitation," but an absolute command requiring full obedience on the part of all hearers.
So believing here would be a good work performed by the Jailor if he obeyed the imperative !
And if his act of obeying this command caused God to save him, then he was saved because of a good work he performed !