A Taipei court has ruled that an inmate who was denied the right to vote by the country's election authorities can cast his ballot from prison.