I tried your example:
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Tab.selected sample", "fixed", 320, 250)
local tab = ui.Tab(win, {"Tab 1", "Tab 2", "Tab 3"})
function tab:onSelect(item)
win:status(item.text.." is selected")
end
tab.selected = tab.items[3]
win:show()
-- update user interface
repeat
ui.update()
until not win.visible
changing tab.selected = tab.items[3], the callback still works as expected but the currently selected tab (visually) intially is still set to 1